! function(e, t, n) {
	t.MGTOOL = {}, e.extend(MGTOOL, {
		byteLength: function(e) {
			var t = e.match(/[^\x00-\x80]/g);
			return e.length + (t ? t.length : 0)
		},
		jsMbSubstr: function(e, t) {
			if (!e || !t) return "";
			var n = 0,
				o = 0,
				r = "",
				i = e.length;
			for (o = 0; i > o; o++) {
				if (n = e.charCodeAt(o) > 255 ? n += 2 : ++n, n > 2 * t) return r;
				r += e.charAt(o)
			}
			return e
		},
		formatMoney: function(e, t, n) {
			if (t = MGTOOL.empty(e) ? "2" : t, MGTOOL.empty(n)) return e.toFixed(t);
			var o = 0 > e ? "-" : "",
				r = parseInt(e = Math.abs(+e || 0).toFixed(t), 10) + "",
				i = (i = r.length) > 3 ? i % 3 : 0;
			return o + (i ? r.substr(0, i) + n : "") + r.substr(i).replace(/(\d{3})(?=\d)/g, "$1" + n) + (t ? "." + Math.abs(e - r).toFixed(t).slice(2) : "")
		}
	}), e.extend(MGTOOL, {
		emptyObj: function(e) {
			for (var t in e) return !1;
			return !0
		},
		empty: function(e) {
			return null == e || 0 === e.length
		},
		objToJson: function(e) {
			return JSON.stringify(e)
		}
	}), e.extend(MGTOOL, {
		setCookie: function(e, t, n) {
			n = n || {}, null === t && (t = "", n.expires = -1);
			var o = "";
			if (n.expires && ("number" == typeof n.expires || n.expires.toUTCString)) {
				var r;
				"number" == typeof n.expires ? (r = new Date, r.setTime(r.getTime() + 864e5 * n.expires)) : r = n.expires, o = "; expires=" + r.toUTCString()
			}
			var i = n.path ? "; path=" + n.path : "",
				u = n.secure ? "; secure" : "",
				a = "";
			n.domain ? a = "; domain=" + n.domain : (a = document.domain.toString().split("."), a = "; domain=." + a[1] + "." + a[2]), document.cookie = [e, "=", encodeURIComponent(t), o, i, a, u].join("")
		},
		getCookie: function(e) {
			var t = document.cookie.match(new RegExp("(^| )" + e + "=([^;]*)(;|$)"));
			return null !== t ? decodeURIComponent(t[2]) : ""
		},
		removeCookie: function(e) {
			MGTOOL.setCookie(e, null, {
				expires: -1
			})
		},
		setCacheCookie: function(t, n, o, r) {
			o = o || {}, null === n && (n = "");
			var i = "undefined" == typeof r ? MGTOOL.getCookie("__mgjuuid") : r;
			e.ajax({
				url: "/collect/uedcookie",
				type: "POST",
				timeout: 6e4,
				data: {
					cookiename: t,
					uuid: i,
					type: "set",
					value: n,
					lifetime: 86400 * o.expires
				},
				dataType: "json",
				success: function(e) {
					"" === e && alert(MGLANG.msgTimeout)
				}
			})
		},
		getCacheCookie: function(t, n) {
			var o = "undefined" == typeof n ? MGTOOL.getCookie("__mgjuuid") : n,
				r = "";
			return e.ajax({
				url: "/collect/uedcookie",
				type: "POST",
				timeout: 6e4,
				async: !1,
				data: {
					cookiename: t,
					uuid: o,
					type: "get"
				},
				dataType: "json",
				success: function(e) {
					var t = e.status.code;
					e.status.msg;
					if (1001 == t) {
						var n = e.result.data.value;
						r = n
					} else alert(MGLANG.msgTimeout)
				}
			}), r
		}
	}), e.extend(MGTOOL, {
		getQueryString: function(e, t) {
			t = "undefined" != typeof t ? t : location.href;
			var n = new RegExp("(^|\\?|&)" + e + "=([^&]*)(\\s|&|$)", "i");
			return n.test(t) ? RegExp.$2.replace(/\+/g, " ") : ""
		},
		getPicExtension: function(e) {
			return /(.+)\.(.+)/.exec(e) ? RegExp.$2 : ""
		},
		filterDomain: function(e) {
			var t = /http:\/\/[^\/]+/;
			return e.replace(t, "")
		}
	}), e.extend(MGTOOL, {
		throttleM: {
			isLoading: !1,
			throttoleXhr: function(e, t) {
				var n = this;
				if (!n.isLoading) {
					t = t || 500, n.isLoading = !0;
					var o = e();
					o.complete = function() {
						setTimeout(function() {
							n.isLoading = !1
						}, t)
					}
				}
			}
		}
	}), e.extend(MGTOOL, {
		getMsgLength: function(e) {
			var t = e.length;
			if (t > 0) {
				for (var n = 41, o = 140, r = 24, i = e, u = e.match(/http[s]?:\/\/[a-zA-Z0-9-]+(\.[a-zA-Z0-9]+)+([-A-Z0-9a-z_\$\.\+\!\*\(\)\/\/,:;@&=\?\~\#\%]*)*/gi) || [], a = 0, s = 0, c = u.length; c > s; s++) {
					var g = MGTOOL.byteLength(u[s]);
					/^(http:\/\/mogujie.cn)/.test(u[s]) || (a += /^(http:\/\/)+(mogujie.cn|mogujie.com)/.test(u[s]) && n >= g ? g : o >= g ? r : g - o + r, i = i.replace(u[s], ""))
				}
				return Math.ceil((a + MGTOOL.byteLength(i)) / 2)
			}
			return 0
		},
		getAbsoluteLocation: function(n) {
			if (1 !== arguments.length || null === n) return null;
			var o = e(n),
				r = o.offset(),
				i = r.top,
				u = r.left,
				a = o.height(),
				s = e(t).height(),
				c = e(document).scrollTop(),
				g = i >= c && c + s >= i,
				l = i + a + 200 >= c && c + s >= i - 400;
			return {
				absoluteTop: i,
				absoluteLeft: u,
				isInView: g,
				isLoad: l
			}
		},
		distance2Bottom: function(n) {
			var o = e(document),
				r = e(t),
				i = o.scrollTop(),
				u = r.height(),
				a = o.height();
			return i + u + n >= a
		},
		isParent: function(e, t) {
			for (; e !== n && null !== e && "BODY" != e.tagName.toUpperCase();) {
				if (e == t) return !0;
				e = e.parentNode
			}
			return !1
		},
		template: function(e, t) {
			return doT.template(e)(t)
		},
		log: function(e) {
			t.console !== n && console.log(e)
		},
		dataFormat: function(e, t) {
			var n = {
				"M+": e.getMonth() + 1,
				"d+": e.getDate(),
				"h+": e.getHours(),
				"m+": e.getMinutes(),
				"s+": e.getSeconds(),
				"q+": Math.floor((e.getMonth() + 3) / 3),
				S: e.getMilliseconds()
			};
			/(y+)/.test(t) && (t = t.replace(RegExp.$1, (e.getFullYear() + "").substr(4 - RegExp.$1.length)));
			for (var o in n) new RegExp("(" + o + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? n[o] : ("00" + n[o]).substr(("" + n[o]).length)));
			return t
		}
	}), e.extend(MGTOOL, {
		trim: function(t) {
			return e.trim(t)
		},
		getRequest: function(e, t) {
			return this.getQueryString(e, t)
		}
	})
}(jQuery, window);
var MOGU = MOGU || {};
! function(t) {
	MOGU.Globe_Textarea_Auto_Height = function(e) {
		var o = e.height(),
			i = function() {
				0 > o && (o = e.height()), (t.browser.mozilla || t.browser.safari) && e.height(o);
				var i = e[0].scrollHeight,
					n = o > i ? o : i;
				n = 1.5 * o > n ? o : i, e.height(n)
			};
		e.bind("keyup", i).bind("input", i).bind("propertychange", i).bind("focus", i)
	}, MOGU.Globe_Goods_URL_Support = function(t) {
		var e = /item(.[\w]+)?.taobao.com\/(.?)[item.htm|item_num_id|item_detail|itemID|item_id|default_item_id]/i,
			o = /detail.tmall/i,
			i = /auction\d?.paipai.com/i,
			n = /buy.caomeipai.com\/goods/i,
			a = /www.360buy.com\/product/i,
			c = /product.dangdang.com\/Product.aspx\?product_id=/i,
			r = /book.360buy.com/i,
			s = /www.vancl.com\/StyleDetail/i,
			u = /www.vancl.com\/Product/i,
			l = /vt.vancl.com\/item/i,
			d = /item.vancl.com\/\d+/i,
			m = /item.vt.vancl.com\/\d+/i,
			w = /(mbaobao.com\/pshow)|(mbaobao.com\/item)/i,
			f = /item.buy.qq.com\/item/i,
			_ = /[www|us].topshop.com\/webapp\/wcs\/stores\/servlet\/ProductDisplay/i,
			p = /quwan.com\/goods/i,
			b = /nala.com.cn\/product/i,
			h = /maymay.cn\/pitem/i,
			v = /asos.com/i,
			g = /www.100f1.com\/ProductInfo_/i,
			y = /www.gaojie.com\/product/i,
			G = /a.m.taobao.com\/i/i,
			O = /www.51yugou.com\//i,
			M = /www.1mall.com\//i,
			U = /www.yihaodian.com\//i,
			k = /www.xipin.me\//i,
			j = /www.nuandao.com\//i,
			x = /www.rosebeauty.com.cn\//i,
			C = /www.hmeili.com\//i,
			T = /www.yueji.com\//i,
			L = /www.yougou.com\//i,
			S = /cn.shopbop.com\//i,
			I = /item.jd.com\//i,
			P = /[www|shop].mogujie.com(.*)\/detail/i;
		return e.test(t) || o.test(t) || r.test(t) || a.test(t) || i.test(t) || n.test(t) || c.test(t) || s.test(t) || u.test(t) || l.test(t) || d.test(t) || m.test(t) || w.test(t) || _.test(t) || p.test(t) || b.test(t) || h.test(t) || v.test(t) || g.test(t) || y.test(t) || f.test(t) || G.test(t) || O.test(t) || U.test(t) || k.test(t) || j.test(t) || x.test(t) || C.test(t) || T.test(t) || L.test(t) || M.test(t) || S.test(t) || I.test(t) || P.test(t)
	}, MOGU.Globe_Input_Text = function(e, o) {
		o = o || e.val(), e.focus(function() {
			var e = t(this);
			t.trim(e.val()) == o && e.val(""), e.css("color", "#000")
		}), e.blur(function() {
			var e = t(this);
			"" == t.trim(e.val()) && (e.val(o), e.css("color", "#ccc"))
		})
	}, MOGU.Globe_Input_Text_Hide = function(e) {
		e.focus(function() {
			var e = t(this);
			t.trim(e.val()) == t.trim(e.attr("def-v")) && e.val(""), e.css("color", "#000")
		}), e.blur(function() {
			var e = t(this);
			"" == t.trim(e.val()) && (e.val(e.attr("def-v")), e.css("color", "#ccc"))
		})
	}, MOGU.WB_Word_Count = function(e, o, i) {
		var n = i ? i : 140;
		if (t("#" + e)[0]) {
			var a = function() {
				var i = 0;
				i = o ? MGTOOL.getMsgLength(t("#" + o).val()) : MGTOOL.getMsgLength(t("#" + e).find(".pub_txt").val());
				var a = n - i;
				0 == i ? t("#" + e).find(".word_count").html(n) : i > n ? (t("#" + e).find(".word_count_wrap").html('您已超过<em class="word_count"></em>个字').find(".word_count").html(Math.abs(a)), t("#" + e).find(".word_count_wrap").show(), t("#" + e).find(".word_count").addClass("out")) : (t("#" + e).find(".word_count_wrap").html('还可以输入<em class="word_count"></em>个字').find(".word_count").html(a), t("#" + e).find(".word_count").removeClass("out"))
			};
			o ? t("#" + o).bind("keyup", a).bind("input", a).bind("propertychange", a) : t("#" + e).find(".pub_txt").bind("keyup", a).bind("input", a).bind("propertychange", a)
		}
	}, MOGU.Globe_Range_Input = function(t) {
		if (t[0].createTextRange) {
			var e = t[0].createTextRange();
			e.moveEnd("character", t.val().length), e.moveStart("character", t.val().length), e.select()
		} else t[0].setSelectionRange(t.val().length, t.val().length), t.focus()
	}, MOGU.Globe_Check_Login = function() {
		return "" == MOGUPROFILE.userid ? (MOGU.user_handsome_login_init(), MOGU.user_handsome_login(), !1) : !0
	}, MOGU.Globe_Short_Link_From = function() {
		t(".mg_slink").live("click", function() {
			var e = window.location.toString();
			if (!(e.indexOf("is_qzone=1") >= 0)) {
				var o = this,
					i = o.href,
					n = t(o).attr("s"),
					a = t(o).attr("c");
				"" == a && (a = MOGUPROFILE.userid);
				var c = i,
					r = "";
				r = -1 == i.indexOf("?") ? "?c=" + a + "&s=" + n : "&c=" + a + "&s=" + n, c += r, o.href = c, setTimeout(function() {
					o.href = i
				}, 500)
			}
		})
	}, MOGU.Globe_Short_Link_From(), MOGU.Globe_Bind_Keybord_Submit = function(e, o, i) {
		i = i || "need_focus", "need_focus" == i && (e.focus(function() {
			t("body").unbind("keydown"), t("body").bind("keydown", function(t) {
				t.ctrlKey && 13 == t.keyCode && o.click()
			})
		}), e.blur(function() {
			t("body").unbind("keydown")
		})), "not_need_focus" == i && t(document).bind("keydown", function(e) {
			e.ctrlKey && 13 == e.keyCode && (o.click(), t("body").unbind("keydown"))
		})
	}, MOGU.GLobe_GetObj_Length = function(t) {
		var e, o = 0;
		for (e in t) t.hasOwnProperty(e) && o++;
		return o
	}, MOGU.Empty_Message_Tip = function(t) {
		var e = t ? t : {},
			o = e.pub_obj,
			i = null,
			n = 0;
		i = setInterval(function() {
			n++, 6 == n ? (clearInterval(i), o.focus()) : n % 2 == 0 ? o.addClass("empty_tip") : o.removeClass("empty_tip")
		}, 120)
	}, MOGU.Defult_Post_data = function(e) {
		if (e instanceof jQuery || (e = t(e)), e.hasClass("disable")) return !1;
		e.addClass("disable");
		var o = e.data(),
			i = o.url || "";
		if ("" !== i) {
			var n = function(t) {
				1001 === t.status.code ? window.location.reload() : alert(t.status.msg)
			};
			jQuery.ajax({
				url: i,
				type: "POST",
				dataType: "json",
				data: o,
				complete: function() {
					e.removeClass("disable")
				},
				success: function(t) {
					n(t)
				}
			})
		}
	}, MOGU.Globe_Trace_Log = function(e) {
		var o = log_stat_url_tmp + "&rerefer=" + encodeURIComponent(window.location.href) + "&tracename=" + e;
		t.ajax({
			url: o,
			type: "post",
			dataType: "jsonp",
			jsonpCallback: "logCallBack",
			success: function() {}
		})
	}, t.fn.serializeObject = function() {
		var e = {},
			o = this.serializeArray();
		return t.each(o, function() {
			void 0 !== e[this.name] ? (e[this.name].push || (e[this.name] = [e[this.name]]), e[this.name].push(this.value || "")) : e[this.name] = this.value || ""
		}), e
	}, MOGU.SerializeFormObject = function(t) {
		t.serializeObject()
	}
}(jQuery), $(function() {
		$(document).off("click", ".__trace__").on("click", ".__trace__", function(t) {
			var e = $(this).attr("data-trace");
			e && MOGU.Globe_Trace_Log(e)
		})
	}),
	function() {
		for (var t, e = function() {}, o = ["assert", "clear", "count", "debug", "dir", "dirxml", "error", "exception", "group", "groupCollapsed", "groupEnd", "info", "log", "markTimeline", "profile", "profileEnd", "table", "time", "timeEnd", "timeStamp", "trace", "warn"], i = o.length, n = window.console = window.console || {}; i--;) t = o[i], n[t] || (n[t] = e)
	}();
window.Messenger = function() {
	function t(t, e) {
		var i = "";
		if (arguments.length < 2 ? i = "target error - target and name are both requied" : "object" != typeof t ? i = "target error - target itself must be window object" : "string" != typeof e && (i = "target error - target name must be string type"), i) throw new Error(i);
		this.target = t, this.name = e
	}

	function e(t, e) {
		this.targets = {}, this.name = t, this.listenFunc = [], i = e || i, this.initListen()
	}
	var i = "[PROJECT_NAME]",
		a = "postMessage" in window;
	return a ? t.prototype.send = function(t) {
		this.target.postMessage(i + t, "*")
	} : t.prototype.send = function(t) {
		var e = window.navigator[i + this.name];
		"function" == typeof e && e(i + t, window)
	}, e.prototype.addTarget = function(e, i) {
		var a = new t(e, i);
		this.targets[i] = a
	}, e.prototype.initListen = function() {
		var t = this,
			e = function(e) {
				"object" == typeof e && e.data && (e = e.data), e = e.slice(i.length);
				for (var a = 0; a < t.listenFunc.length; a++) t.listenFunc[a](e)
			};
		a ? "addEventListener" in document ? window.addEventListener("message", e, !1) : "attachEvent" in document && window.attachEvent("onmessage", e) : window.navigator[i + this.name] = e
	}, e.prototype.listen = function(t) {
		this.listenFunc.push(t)
	}, e.prototype.clear = function() {
		this.listenFunc = []
	}, e.prototype.send = function(t) {
		var e, i = this.targets;
		for (e in i) i.hasOwnProperty(e) && i[e].send(t)
	}, e
}();
var MOGU = window.MOGU || {};
MOGU.alert = MOGU.alert || function(t) {
	window.alert(t)
}, MOGU.IM_Module = function(t, e, i, a, o, n, r) {
	n = n || (n = MoGu.util);
	var s = "http://www.mogujie.com",
		d = t.ActiveXObject && !t.XMLHttpRequest ? !0 : !1,
		c = {
			style2: {
				width: "82",
				height: "26"
			},
			"default": {
				width: "85",
				height: "24"
			},
			widget1: {
				width: "40",
				height: "55"
			},
			widget2: {
				width: "40",
				height: "55"
			},
			widget3: {
				width: "18",
				height: "22"
			},
			widget4: {
				width: "48",
				height: "20"
			},
			yaya_style: {
				width: "64",
				height: "70"
			},
			pc: {
				width: "16",
				height: "17"
			},
			xd_style: {
				width: "75",
				height: "25"
			}
		},
		l = null,
		m = function(t) {
			for (var e in c)
				if (t.hasClass(e)) return e;
			return null
		},
		u = function(t, e) {
			if (void 0 === e) {
				var i = n.getCookie(t);
				return "" === i ? void 0 : r.parse(i)
			}
			n.setCookie(t, r.stringify(e), {
				expires: 1,
				path: "/"
			})
		},
		p = function(t, e) {
			if (void 0 === e) {
				var i = n.getCookie(t);
				return "" === i ? void 0 : i
			}
			n.setCookie(t, e, {
				expires: 1,
				path: "/"
			})
		},
		h = function(t) {
			var e, a, o, n;
			a = ['<div id="J_im_loadingdom" class="im-waiting">', '<img class="lo_yaya" src="images/upload_ieywmy3ege2tsm3fgmzdambqmeyde_92x92.png" width="92" height="92">', '<p class="lo_word J_im_loading_dis"></p>', "</div>"].join(""), e = ['<style id="J_im_loadingstyle">', '.im-waiting{display:none;position:fixed;left:50%;top:50%;margin-left:-66px;margin-top:-66px;width:130px;height:130px;background:#fff;border:1px solid #dcdcdc;z-index:1000;border-radius:8px;box-shadow:0 0 12px rgba(0, 0, 0, .3);_position:absolute;_top:expression(document.compatMode && document.compatMode=="CSS1Compat"?documentElement.scrollTop+documentElement.clientHeight/2:document.body.scrollTop+document.body.clientHeight/2);}', ".im-waiting .lo_yaya{display:block;margin:4px auto 0;}", ".im-waiting .lo_word{color:#f46;text-align:center;font-size:12px;}", "</style>"].join(""), o = i("#J_im_loadingstyle"), o.length <= 0 && i("head").append(e), n = i("#J_im_loadingdom"), n.length <= 0 && (n = i(a), i("body").append(n)), n.find(".J_im_loading_dis").html(t), n.show(300), setTimeout(function() {
				f()
			}, 3e4)
		},
		f = function() {
			i("#J_im_loadingdom").hide(300)
		},
		g = function(t, e, a, n, r) {
			var c, l, m, u, f = /com\/detail\/(1[a-z0-9]+)/;
			c = s + "/mtalk/imv2/", o && o.atc && (c += "?atc=" + o.atc), l = ['<style id="J_imframe_style">', '.im-frame{position:fixed;visibility:hidden;width:569px;height:418px;right:120px;bottom:36px;z-index:1000;_position:absolute;_bottom:auto;_top:expression((document.compatMode && document.compatMode=="CSS1Compat"?documentElement.scrollTop+(documentElement.clientHeight-this.clientHeight):document.body.scrollTop+(document.body.clientHeight-this.clientHeight))-36);}', ".im-closed{right:-600px!important;_right:120px;_display:none;}", ".im-frame-proxy{position:fixed;width:476px;height:28px;right:148px;bottom:401px;z-index:1001;cursor:move;}", ".im-proxy-closed{display:none;}", ".ST_im-frame-proxy-move{background:#EBFAFF;opacity:.8;filter:alpha(opacity=80);}", "html,body{_background-image:url(about:blank);_background-attachment:fixed;}", "</style>"].join(""), m = ['<iframe class="im-frame im-closed" id="J_imframe" src="" allowtransparency="true" scrolling="no" marginwidth="0" marginheight="0" width="569" height="418" frameborder="0"></iframe>'].join(""), u = ['<div class="im-frame-proxy im-proxy-closed" id="J_imframe_proxy"></div>'].join("");
			var g = i("#J_imframe_style");
			g.length <= 0 && i("head").append(l);
			var y = i("#J_imframe"),
				_ = i("#J_imframe_proxy");
			if (y.length <= 0 && (y = i(m), _ = i(u), i("body").append(y), d || i("body").append(_), setTimeout(function() {
					y.css("visibility", "visible")
				}, 1e3), h("正在连接...")), y.hasClass("im-closed") && (y.removeClass("im-closed"), _.removeClass("im-proxy-closed")), t) y.attr("src", c + "#chat/" + t);
			else if (e) {
				e.indexOf("#") < 0 && (e += "#23");
				var w = decodeURIComponent(n).match(f),
					b = "";
				w && w[1] && (b += "/g" + w[1]), y.attr("src", c + "#chat/b" + encodeURIComponent(e) + b)
			} else {
				var v = p("imcuid");
				v = v && v.split("/"), v && "hold" === v[0] && v[1] ? y.attr("src", c + "#chat/" + v[1]) : y.attr("src", c + "#chat")
			}
		},
		y = function(e, a, o, n, d, c, m, p) {
			if ("service" === o) {
				var h, f, y, _, w;
				t.webkitNotifications && 0 !== t.webkitNotifications.checkPermission() && t.webkitNotifications.requestPermission(function() {}), _ = "__mogutalk_boot", w = {
					enable: "true"
				}, e ? (w.uid = e, u(_, w)) : a && (a.indexOf("#") < 0 && (a += "#23"), w.bid = a, u(_, w)), f = u("__mogutalk_life"), y = +new Date, h = Math.abs(y - parseInt(f, 10)), (void 0 === f || h > 4e3) && t.open(s + "/mtalk", "im", "top=50,left=100,width=1000,height=640,location=yes,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no")
			} else if ("cm" === o) {
				var b = {};
				c && "true" === c && (m && (b.sign = m), p && (b._did = p), b.imclient = "1.0"), i.ajax({
					url: "/mtalk/im/calltobusiness",
					data: b,
					type: "POST",
					dataType: "json",
					success: function() {}
				})
			} else self !== top ? l && l.send(r.stringify({
				code: 1001,
				data: {
					uid: e,
					bid: a,
					utype: o,
					refer: n,
					from: d
				}
			})) : g(e, a, o, n, d)
		},
		_ = function() {
			self !== top ? (l = new Messenger("Frame", "ImFrame"), l.addTarget(t.parent, "Parent")) : (l = new Messenger("Parent", "ImFrame"), l.listen(function(t) {
				try {
					switch (t = r.parse(t), t.code) {
						case 1001:
							var e = t.data;
							y(e.uid, e.bid, e.utype, e.refer, e.from);
							break;
						case 1002:
							i("#J_imframe").addClass("im-closed"), i("#J_imframe_proxy").addClass("im-proxy-closed");
							break;
						case 1003:
							i("#J_imframe").remove(), i("#J_imframe_proxy").remove(), f();
							break;
						case 1004:
							i("#J_imframe").removeClass("im-closed"), i("#J_imframe_proxy").removeClass("im-proxy-closed");
							break;
						case 1005:
							a.user_handsome_login_init(), a.user_handsome_login(!1, {
								callback: function() {
									location.reload()
								}
							});
							break;
						case 1006:
							var e = t.data;
							e.msg && a.alert(e.msg);
							break;
						case 1007:
							var e = t.data;
							e && e.msg ? h(e.msg) : f()
					}
				} catch (o) {}
			}))
		},
		w = function() {
			var t = function(t) {
				if (t) {
					var e, a, n, r, d, l, m, u, p, h, f, g, y, _;
					if (e = i(t), a = e.attr("data-style"), m = e.attr("data-bid"), u = e.attr("data-uid"), p = e.attr("data-type"), client = e.attr("data-client"), h = e.attr("data-from"), f = e.html(), y = e.attr("data-sign"), _ = e.attr("data-did"), n = c[a], void 0 !== n && (r = n.width, d = n.height, g = "" === o.userid ? "x" : "√", l = [s + "/mtalk/widget/enterbutton?", "style=", a, "&width=", r, "&height=", d, "&cnt=", encodeURIComponent(f), "&islogin=", encodeURIComponent(g)], u ? (l.push("&uid="), l.push(encodeURIComponent(u))) : m && (l.push("&bid="), l.push(encodeURIComponent(m))), p && (l.push("&type="), l.push(encodeURIComponent(p))), u || m || p)) {
						client && "true" === client && (l.push("&client="), l.push(encodeURIComponent(client)), l.push("&sign="), l.push(encodeURIComponent(y)), l.push("&_did="), l.push(encodeURIComponent(_))), l.push("&from=" + (h || "")), l.push("&refer=" + encodeURIComponent(location.href));
						var w = i('<iframe src="" width="' + r + '" height="' + d + '" frameborder="0" scrolling="no" marginheight="0" allowtransparency="true"></iframe>');
						e.html(w), w.attr("src", l.join(""))
					}
				}
			};
			i(".mogutalk_widget_btn").each(function(e) {
				t(this)
			}), i(e).on("createim:widget", function(e, i) {
				t(i)
			})
		},
		b = function() {
			i(".mogutalk_btn").each(function() {
				var t, e, a, n, r, s, d, c = null,
					l = !1;
				if (t = i(this), c = m(t), null !== c) {
					if (r = t.attr("data-islogin"), (o && "" !== o.userid || r && "√" === r) && (l = !0), a = t.attr("data-uid"), n = t.attr("data-bid"), s = t.attr("data-sign"), d = t.attr("data-did"), e = {}, data_block = {}, e.sign = s, e._did = d, data_block.sign = s, data_block._did = d, a) e.userId = a, data_block.uid = a;
					else {
						if (!n) return;
						n.indexOf("#") < 0 && (n += "#23"), e.shopId = n.split("#")[0], e.type = n.split("#")[1], data_block.bid = n.split("#")[0]
					}
					i.ajax({
						url: "/mtalk/im/customeronline",
						data: e,
						dataType: "json",
						success: function(e) {
							if (e && 1001 === e.status.code) {
								var i = 1 === e.result.isOnline ? !0 : !1;
								i || (t.addClass("mogutalk_btn_offline"), "default" !== c && t.addClass(c + "_offline"))
							}
						}
					}), l && i.ajax({
						url: "/mtalk/user/isblock",
						data: data_block,
						dataType: "json",
						success: function(e) {
							void 0 !== e && 1001 === e.status.code && e.result && e.result.isBlock === !0 && t.addClass("isblock")
						}
					})
				}
			})
		},
		v = function() {
			i(e).on("click", ".mogutalk_btn", function(t) {
				t.preventDefault();
				var e, n, d, c, m, u, p, h, f, g;
				if (e = i(this), n = !1, u = e.attr("data-islogin"), (o && "" !== o.userid || u && "√" === u) && (n = !0), !n) {
					if (o) return a.user_handsome_login_init(), void a.user_handsome_login(!1, {
						callback: function() {
							location.reload()
						}
					});
					if (u) return void(l ? l.send(r.stringify({
						code: 1005
					})) : top.location.href = s + "/login?refer=" + e.attr("data-refer"))
				}
				if (d = e.attr("data-uid"), c = e.attr("data-bid"), m = e.attr("data-type"), h = e.attr("data-refer"), p = e.attr("data-from"), client = e.attr("data-client"), f = e.attr("data-sign"), g = e.attr("data-did"), e.hasClass("isblock")) {
					var _ = "您不能和对方对话～";
					return void(o ? a.alert(_) : l && l.send(r.stringify({
						code: 1006,
						data: {
							msg: _
						}
					})))
				}
				y(d, c, m, h, p, client, f, g)
			}), i(e).on("click", ".duoduo_chat", function(t) {
				t.preventDefault();
				var e = i(this).attr("data-uid");
				i.ajax({
					url: "/mtalk/im/calltotalk",
					data: {
						uid: e
					},
					type: "POST",
					dataType: "json",
					success: function(t) {
						t && t.status ? 1001 === t.status.code ? a.alert("已联系用户，请切换到多多查看！") : 1002010 === t.status.code ? a.alert("请先登录多多！") : a.alert(t.status.msg) : a.alert("网络错误，请稍后再试")
					}
				})
			})
		},
		x = function() {
			var t = {
					startX: 148,
					startY: 401,
					mouseStartX: 0,
					mouseStartY: 0,
					originWidth: 476,
					originHeight: 28,
					width: 569,
					height: 418,
					offsetX: -28,
					offsetY: -365
				},
				a = i("#J_imframe"),
				o = 0,
				n = function() {
					var e = i(".im-frame-proxy");
					e.length <= 0 || (e.animate({
						right: t.startX + t.offsetX + "px",
						bottom: t.startY + t.offsetY + "px"
					}, 100, function() {
						e.css({
							width: t.originWidth + "px",
							height: t.originHeight + "px",
							right: t.startX + "px",
							bottom: t.startY + "px"
						}).removeClass("ST_im-frame-proxy-move")
					}), a.length <= 0 && (a = i("#J_imframe")), a.animate({
						opacity: 1
					}, 100))
				},
				r = function() {
					clearTimeout(o), o = setTimeout(function() {
						n()
					}, 500)
				};
			i(e).on("mousedown", ".im-frame-proxy", function(e) {
				e.preventDefault();
				var o = i(this);
				t.startX = parseInt(o.css("right"), 10), t.startY = parseInt(o.css("bottom"), 10), t.mouseStartX = e.clientX, t.mouseStartY = e.clientY, o.css({
					width: t.width + "px",
					height: t.height + "px",
					right: t.startX + t.offsetX + "px",
					bottom: t.startY + t.offsetY + "px"
				}).addClass("ST_im-frame-proxy-move"), a.length <= 0 && (a = i("#J_imframe")), a.animate({
					opacity: .9
				}, 100), r()
			}).on("mousemove", ".ST_im-frame-proxy-move", function(e) {
				e.preventDefault();
				var a = i(this);
				a.css({
					right: t.startX + (t.mouseStartX - e.clientX) + t.offsetX + "px",
					bottom: t.startY + (t.mouseStartY - e.clientY) + t.offsetY + "px"
				}), r()
			}).on("mouseup", ".im-frame-proxy", function(e) {
				e.preventDefault();
				var n = i(this);
				t.startX = t.startX + (t.mouseStartX - e.clientX), t.startY = t.startY + (t.mouseStartY - e.clientY), n.css({
					width: t.originWidth + "px",
					height: t.originHeight + "px",
					right: t.startX + "px",
					bottom: t.startY + "px"
				}).removeClass("ST_im-frame-proxy-move"), a.length <= 0 && (a = i("#J_imframe")), a.css({
					right: t.startX + t.offsetX + "px",
					bottom: t.startY + t.offsetY + "px"
				}), a.animate({
					opacity: 1
				}, 100), clearTimeout(o)
			})
		};
	return {
		init: function() {
			_(), w(), b(), v(), d || x()
		}
	}
}(window, document, jQuery, window.MOGU, window.MOGUPROFILE, window.MGTOOL, window.JSON), $(document).ready(function() {
	MOGU.IM_Module.init()
});
var swfobject = function() {
	function e() {
		if (!G) {
			try {
				var e = M.getElementsByTagName("body")[0].appendChild(h("span"));
				e.parentNode.removeChild(e)
			} catch (t) {
				return
			}
			G = !0;
			for (var n = R.length, a = 0; n > a; a++) R[a]()
		}
	}

	function t(e) {
		G ? e() : R[R.length] = e
	}

	function n(e) {
		if (typeof x.addEventListener != L) x.addEventListener("load", e, !1);
		else if (typeof M.addEventListener != L) M.addEventListener("load", e, !1);
		else if (typeof x.attachEvent != L) m(x, "onload", e);
		else if ("function" == typeof x.onload) {
			var t = x.onload;
			x.onload = function() {
				t(), e()
			}
		} else x.onload = e
	}

	function a() {
		P ? i() : r()
	}

	function i() {
		var e = M.getElementsByTagName("body")[0],
			t = h(k);
		t.setAttribute("type", O);
		var n = e.appendChild(t);
		if (n) {
			var a = 0;
			! function() {
				if (typeof n.GetVariable != L) {
					var i = n.GetVariable("$version");
					i && (i = i.split(" ")[1].split(","), X.pv = [parseInt(i[0], 10), parseInt(i[1], 10), parseInt(i[2], 10)])
				} else if (10 > a) return a++, void setTimeout(arguments.callee, 10);
				e.removeChild(t), n = null, r()
			}()
		} else r()
	}

	function r() {
		var e = D.length;
		if (e > 0)
			for (var t = 0; e > t; t++) {
				var n = D[t].id,
					a = D[t].callbackFn,
					i = {
						success: !1,
						id: n
					};
				if (X.pv[0] > 0) {
					var r = y(n);
					if (r)
						if (!g(D[t].swfVersion) || X.wk && X.wk < 312)
							if (D[t].expressInstall && s()) {
								var f = {};
								f.data = D[t].expressInstall, f.width = r.getAttribute("width") || "0", f.height = r.getAttribute("height") || "0", r.getAttribute("class") && (f.styleclass = r.getAttribute("class")), r.getAttribute("align") && (f.align = r.getAttribute("align"));
								for (var d = {}, u = r.getElementsByTagName("param"), p = u.length, v = 0; p > v; v++) "movie" != u[v].getAttribute("name").toLowerCase() && (d[u[v].getAttribute("name")] = u[v].getAttribute("value"));
								l(f, d, n, a)
							} else c(r), a && a(i);
					else b(n, !0), a && (i.success = !0, i.ref = o(n), a(i))
				} else if (b(n, !0), a) {
					var h = o(n);
					h && typeof h.SetVariable != L && (i.success = !0, i.ref = h), a(i)
				}
			}
	}

	function o(e) {
		var t = null,
			n = y(e);
		if (n && "OBJECT" == n.nodeName)
			if (typeof n.SetVariable != L) t = n;
			else {
				var a = n.getElementsByTagName(k)[0];
				a && (t = a)
			}
		return t
	}

	function s() {
		return !J && g("6.0.65") && (X.win || X.mac) && !(X.wk && X.wk < 312)
	}

	function l(e, t, n, a) {
		J = !0, A = a || null, N = {
			success: !1,
			id: n
		};
		var i = y(n);
		if (i) {
			"OBJECT" == i.nodeName ? (E = f(i), S = null) : (E = i, S = n), e.id = F, (typeof e.width == L || !/%$/.test(e.width) && parseInt(e.width, 10) < 310) && (e.width = "310"), (typeof e.height == L || !/%$/.test(e.height) && parseInt(e.height, 10) < 137) && (e.height = "137"), M.title = M.title.slice(0, 47) + " - Flash Player Installation";
			var r = X.ie && X.win ? "ActiveX" : "PlugIn",
				o = "MMredirectURL=" + x.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + r + "&MMdoctitle=" + M.title;
			if (typeof t.flashvars != L ? t.flashvars += "&" + o : t.flashvars = o, X.ie && X.win && 4 != i.readyState) {
				var s = h("div");
				n += "SWFObjectNew", s.setAttribute("id", n), i.parentNode.insertBefore(s, i), i.style.display = "none",
					function() {
						4 == i.readyState ? i.parentNode.removeChild(i) : setTimeout(arguments.callee, 10)
					}()
			}
			d(e, t, n)
		}
	}

	function c(e) {
		if (X.ie && X.win && 4 != e.readyState) {
			var t = h("div");
			e.parentNode.insertBefore(t, e), t.parentNode.replaceChild(f(e), t), e.style.display = "none",
				function() {
					4 == e.readyState ? e.parentNode.removeChild(e) : setTimeout(arguments.callee, 10)
				}()
		} else e.parentNode.replaceChild(f(e), e)
	}

	function f(e) {
		var t = h("div");
		if (X.win && X.ie) t.innerHTML = e.innerHTML;
		else {
			var n = e.getElementsByTagName(k)[0];
			if (n) {
				var a = n.childNodes;
				if (a)
					for (var i = a.length, r = 0; i > r; r++) 1 == a[r].nodeType && "PARAM" == a[r].nodeName || 8 == a[r].nodeType || t.appendChild(a[r].cloneNode(!0))
			}
		}
		return t
	}

	function d(e, t, n) {
		var a, i = y(n);
		if (X.wk && X.wk < 312) return a;
		if (i)
			if (typeof e.id == L && (e.id = n), X.ie && X.win) {
				var r = "";
				for (var o in e) e[o] != Object.prototype[o] && ("data" == o.toLowerCase() ? t.movie = e[o] : "styleclass" == o.toLowerCase() ? r += ' class="' + e[o] + '"' : "classid" != o.toLowerCase() && (r += " " + o + '="' + e[o] + '"'));
				var s = "";
				for (var l in t) t[l] != Object.prototype[l] && (s += '<param name="' + l + '" value="' + t[l] + '" />');
				i.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + r + ">" + s + "</object>", W[W.length] = e.id, a = y(e.id)
			} else {
				var c = h(k);
				c.setAttribute("type", O);
				for (var f in e) e[f] != Object.prototype[f] && ("styleclass" == f.toLowerCase() ? c.setAttribute("class", e[f]) : "classid" != f.toLowerCase() && c.setAttribute(f, e[f]));
				for (var d in t) t[d] != Object.prototype[d] && "movie" != d.toLowerCase() && u(c, d, t[d]);
				i.parentNode.replaceChild(c, i), a = c
			}
		return a
	}

	function u(e, t, n) {
		var a = h("param");
		a.setAttribute("name", t), a.setAttribute("value", n), e.appendChild(a)
	}

	function p(e) {
		var t = y(e);
		t && "OBJECT" == t.nodeName && (X.ie && X.win ? (t.style.display = "none", function() {
			4 == t.readyState ? v(e) : setTimeout(arguments.callee, 10)
		}()) : t.parentNode.removeChild(t))
	}

	function v(e) {
		var t = y(e);
		if (t) {
			for (var n in t) "function" == typeof t[n] && (t[n] = null);
			t.parentNode.removeChild(t)
		}
	}

	function y(e) {
		var t = null;
		try {
			t = M.getElementById(e)
		} catch (n) {}
		return t
	}

	function h(e) {
		return M.createElement(e)
	}

	function m(e, t, n) {
		e.attachEvent(t, n), H[H.length] = [e, t, n]
	}

	function g(e) {
		var t = X.pv,
			n = e.split(".");
		return n[0] = parseInt(n[0], 10), n[1] = parseInt(n[1], 10) || 0, n[2] = parseInt(n[2], 10) || 0, t[0] > n[0] || t[0] == n[0] && t[1] > n[1] || t[0] == n[0] && t[1] == n[1] && t[2] >= n[2] ? !0 : !1
	}

	function w(e, t, n, a) {
		if (!X.ie || !X.mac) {
			var i = M.getElementsByTagName("head")[0];
			if (i) {
				var r = n && "string" == typeof n ? n : "screen";
				if (a && (T = null, I = null), !T || I != r) {
					var o = h("style");
					o.setAttribute("type", "text/css"), o.setAttribute("media", r), T = i.appendChild(o), X.ie && X.win && typeof M.styleSheets != L && M.styleSheets.length > 0 && (T = M.styleSheets[M.styleSheets.length - 1]), I = r
				}
				X.ie && X.win ? T && typeof T.addRule == k && T.addRule(e, t) : T && typeof M.createTextNode != L && T.appendChild(M.createTextNode(e + " {" + t + "}"))
			}
		}
	}

	function b(e, t) {
		if (U) {
			var n = t ? "visible" : "hidden";
			G && y(e) ? y(e).style.visibility = n : w("#" + e, "visibility:" + n)
		}
	}

	function C(e) {
		var t = /[\\\"<>\.;]/,
			n = null != t.exec(e);
		return n && typeof encodeURIComponent != L ? encodeURIComponent(e) : e
	}
	var E, S, A, N, T, I, L = "undefined",
		k = "object",
		j = "Shockwave Flash",
		B = "ShockwaveFlash.ShockwaveFlash",
		O = "application/x-shockwave-flash",
		F = "SWFObjectExprInst",
		$ = "onreadystatechange",
		x = window,
		M = document,
		V = navigator,
		P = !1,
		R = [a],
		D = [],
		W = [],
		H = [],
		G = !1,
		J = !1,
		U = !0,
		X = function() {
			var e = typeof M.getElementById != L && typeof M.getElementsByTagName != L && typeof M.createElement != L,
				t = V.userAgent.toLowerCase(),
				n = V.platform.toLowerCase(),
				a = n ? /win/.test(n) : /win/.test(t),
				i = n ? /mac/.test(n) : /mac/.test(t),
				r = /webkit/.test(t) ? parseFloat(t.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : !1,
				o = !1,
				s = [0, 0, 0],
				l = null;
			if (typeof V.plugins != L && typeof V.plugins[j] == k) l = V.plugins[j].description, !l || typeof V.mimeTypes != L && V.mimeTypes[O] && !V.mimeTypes[O].enabledPlugin || (P = !0, o = !1, l = l.replace(/^.*\s+(\S+\s+\S+$)/, "$1"), s[0] = parseInt(l.replace(/^(.*)\..*$/, "$1"), 10), s[1] = parseInt(l.replace(/^.*\.(.*)\s.*$/, "$1"), 10), s[2] = /[a-zA-Z]/.test(l) ? parseInt(l.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0);
			else if (typeof x.ActiveXObject != L) try {
				var c = new ActiveXObject(B);
				c && (l = c.GetVariable("$version"), l && (o = !0, l = l.split(" ")[1].split(","), s = [parseInt(l[0], 10), parseInt(l[1], 10), parseInt(l[2], 10)]))
			} catch (f) {}
			return {
				w3: e,
				pv: s,
				wk: r,
				ie: o,
				win: a,
				mac: i
			}
		}();
	(function() {
		X.w3 && ((typeof M.readyState != L && "complete" == M.readyState || typeof M.readyState == L && (M.getElementsByTagName("body")[0] || M.body)) && e(), G || (typeof M.addEventListener != L && M.addEventListener("DOMContentLoaded", e, !1), X.ie && X.win && (M.attachEvent($, function() {
			"complete" == M.readyState && (M.detachEvent($, arguments.callee), e())
		}), x == top && ! function() {
			if (!G) {
				try {
					M.documentElement.doScroll("left")
				} catch (t) {
					return void setTimeout(arguments.callee, 0)
				}
				e()
			}
		}()), X.wk && ! function() {
			return G ? void 0 : /loaded|complete/.test(M.readyState) ? void e() : void setTimeout(arguments.callee, 0)
		}(), n(e)))
	})(),
	function() {
		X.ie && X.win && window.attachEvent("onunload", function() {
			for (var e = H.length, t = 0; e > t; t++) H[t][0].detachEvent(H[t][1], H[t][2]);
			for (var n = W.length, a = 0; n > a; a++) p(W[a]);
			for (var i in X) X[i] = null;
			X = null;
			for (var r in swfobject) swfobject[r] = null;
			swfobject = null
		})
	}();
	return {
		registerObject: function(e, t, n, a) {
			if (X.w3 && e && t) {
				var i = {};
				i.id = e, i.swfVersion = t, i.expressInstall = n, i.callbackFn = a, D[D.length] = i, b(e, !1)
			} else a && a({
				success: !1,
				id: e
			})
		},
		getObjectById: function(e) {
			return X.w3 ? o(e) : void 0
		},
		embedSWF: function(e, n, a, i, r, o, c, f, u, p) {
			var v = {
				success: !1,
				id: n
			};
			X.w3 && !(X.wk && X.wk < 312) && e && n && a && i && r ? (b(n, !1), t(function() {
				a += "", i += "";
				var t = {};
				if (u && typeof u === k)
					for (var y in u) t[y] = u[y];
				t.data = e, t.width = a, t.height = i;
				var h = {};
				if (f && typeof f === k)
					for (var m in f) h[m] = f[m];
				if (c && typeof c === k)
					for (var w in c) typeof h.flashvars != L ? h.flashvars += "&" + w + "=" + c[w] : h.flashvars = w + "=" + c[w];
				if (g(r)) {
					var C = d(t, h, n);
					t.id == n && b(n, !0), v.success = !0, v.ref = C
				} else {
					if (o && s()) return t.data = o, void l(t, h, n, p);
					b(n, !0)
				}
				p && p(v)
			})) : p && p(v)
		},
		switchOffAutoHideShow: function() {
			U = !1
		},
		ua: X,
		getFlashPlayerVersion: function() {
			return {
				major: X.pv[0],
				minor: X.pv[1],
				release: X.pv[2]
			}
		},
		hasFlashPlayerVersion: g,
		createSWF: function(e, t, n) {
			return X.w3 ? d(e, t, n) : void 0
		},
		showExpressInstall: function(e, t, n, a) {
			X.w3 && s() && l(e, t, n, a)
		},
		removeSWF: function(e) {
			X.w3 && p(e)
		},
		createCSS: function(e, t, n, a) {
			X.w3 && w(e, t, n, a)
		},
		addDomLoadEvent: t,
		addLoadEvent: n,
		getQueryParamValue: function(e) {
			var t = M.location.search || M.location.hash;
			if (t) {
				if (/\?/.test(t) && (t = t.split("?")[1]), null == e) return C(t);
				for (var n = t.split("&"), a = 0; a < n.length; a++)
					if (n[a].substring(0, n[a].indexOf("=")) == e) return C(n[a].substring(n[a].indexOf("=") + 1))
			}
			return ""
		},
		expressInstallCallback: function() {
			if (J) {
				var e = y(F);
				e && E && (e.parentNode.replaceChild(E, e), S && (b(S, !0), X.ie && X.win && (E.style.display = "block")), A && A(N)), J = !1
			}
		}
	}
}();
var imio = function(t, o, e, n, i) {
	function a(t) {
		this.e_pre = "imio:", this.data = {
			connectionStatus: !1,
			connectionType: null,
			service: ""
		}, this.config = e.extend({
			connectMethod: ["serviceHost", "ajaxServiceHost", "ajaxServiceBakHost"],
			socketSwf: MOGUPROFILE.cdnHost + "/dist/swf/push.v1.swf",
			serviceHost: "122.225.67.108:101.68.210.108:8808",
			ajaxServiceHost: "http://122.225.67.108:80",
			ajaxServiceBakHost: "http://101.68.210.108:80",
			timestamp: +new Date
		}, t)
	}
	var c = function(t) {
		if ("object" != typeof t) return null;
		var o, e = parseInt(100 * Math.random(), 10) + 100,
			n = "",
			i = 0;
		for (var a in t) n += t[a];
		o = n.split("");
		for (var c = 0, s = o.length; s > c; c++) i += o[c].charCodeAt();
		return t._n = e, t._p = i % e, t
	};
	return a.prototype.emit = function(t) {
		return this.uinfo = e.extend({
			uid: "",
			uuid: "",
			token: ""
		}, t), this.uinfo.uid ? window.__MgjCinfoOn ? void this.connectSvr() : !1 : void 0
	}, a.prototype.on = function(t, n) {
		e(o).on(this.e_pre + t, function(t, o) {
			n && n(o)
		})
	}, a.prototype.trigger = function(t, n) {
		e(o).trigger(this.e_pre + t, [n])
	}, a.prototype.connectSvr = function() {
		var t = this,
			o = t.config.connectMethod,
			e = {
				serviceHost: "flash",
				ajaxServiceHost: "ajax",
				ajaxServiceBakHost: "ajax"
			},
			i = n.getFlashPlayerVersion();
		if (void 0 === i || 0 === i.major)
			for (var a = 0, c = o.length; c > a; a++)
				if ("serviceHost" === o[a]) {
					o.splice(a, 1);
					break
				}
		var s = 0;
		! function r(n) {
			var i = t.data.connectionStatus;
			if (!i && n) t.data.service = t.config[n], t.data.connectionType = e[n], t.start(e[n]);
			else if (!i && void 0 === n) return t.trigger("loading:status", "timeout"), void clearTimeout(s);
			s = setTimeout(function() {
				var e = o.shift();
				t.data.connectionStatus || (r(e), e && t.trigger("loading:status", "reconnect"))
			}, 1e4)
		}(o.shift())
	}, a.prototype.httpConnect = function() {
		e("#imioflashobj").remove();
		var t = this,
			o = {
				uid: t.uinfo.uid,
				token: t.uinfo.token,
				status: 1
			};
		o = c(o), e.ajax({
			url: t.data.service + "/push/login",
			data: o,
			dataType: "jsonp",
			timeout: 9e3,
			success: function(o) {
				if (o && 1001 === o.status.code) {
					if (t.data.connectionStatus) return;
					t.uinfo.uuid = o.result.uuid, t.call(encodeURIComponent('{"code":1001,"type":"_imioLoginCB"}')), t.startPoll(), t.autoToken(), t.send("getUnReadCounter")
				}
			}
		})
	}, a.prototype.flashConnect = function() {
		var t = this,
			o = e("#imioflashobj");
		o.length <= 0 && (o = e('<span id="imioflashobj"></span>'), e("body").append(o));
		var i = t.config,
			a = e.extend({
				serverList: i.serviceHost
			}, t.uinfo),
			c = {
				wmode: "transplate",
				allowscriptaccess: "always"
			},
			s = {
				id: "imioflashobj",
				name: "imioflashobj"
			};
		window._imioSocket = {
			call: function(o) {
				t.connectionStatus || t.autoToken(), t.call(o)
			}
		}, n.embedSWF(t.config.socketSwf + "?_=" + t.config.timestamp, "imioflashobj", "0", "0", "9.0.0", "", a, c, s)
	}, a.prototype.start = function(t) {
		"flash" === t ? this.flashConnect() : "ajax" === t && this.httpConnect()
	}, a.prototype.startPoll = function() {
		var t = this,
			o = (t.config, t.uinfo);
		! function n() {
			e.ajax({
				url: t.data.service + "/push/poll",
				data: {
					uid: o.uid,
					uuid: o.uuid,
					token: o.token,
					type: "poll"
				},
				type: "GET",
				dataType: "jsonp",
				timeout: 5e4,
				success: function(o) {
					return null === o || (t.call(encodeURIComponent(i.stringify(o))), "errorCode" !== o.type || 4011 !== o.data && 4002 !== o.data && 4005 !== o.data && 4444 !== o.data) ? void n() : void t.showNotice(o.data)
				},
				error: function() {
					t.showNotice(6002)
				}
			})
		}()
	}, a.prototype.autoToken = function() {
		var t = this;
		t.startAutoToken || (! function o() {
			setTimeout(function() {
				e.ajax({
					url: "http://www.mogujie.com/mtalk/iauth",
					type: "GET",
					data: null,
					dataType: "jsonp",
					success: function(e) {
						e && e.status && 1001 === e.status.code && (t.uinfo.token = e.result.token, o())
					}
				})
			}, 36e5)
		}(), t.startAutoToken = !0)
	}, a.prototype.showNotice = function(t) {
		t += "";
		var o = {
			4004: "消息发送超时",
			6000: "网络连接出错",
			6001: "您不能和对方对话",
			10001: "抱歉！没有客服在线",
			4002: "参数错误，请重新登录",
			4003: "您已断开连接，请重新登录",
			4005: "用户校验失败，请重新登陆",
			4011: "您已在其他地方上线，请重新打开",
			4444: "您已经离线，请重新打开",
			6002: "连接失败，请重新打开"
		};
		this.trigger("notice:show", {
			code: +t,
			msg: void 0 === o[t] ? "未知错误[" + t + "]" : o[t]
		})
	}, a.prototype.call = function(t) {
		t = i.parse(decodeURIComponent(t));
		var o = this;
		if (t && 1001 === t.code) switch (t.type) {
			case "_imioLoginCB":
				o.data.connectionStatus = !0;
				break;
			case "_imioSocket":
				o.trigger("data:update", t.data)
		}
	}, a.prototype.send = function(t, o) {
		o = encodeURIComponent(i.stringify(o));
		var n = this;
		if ("flash" === n.data.connectionType) {
			var a = e("#imioflashobj")[0];
			if (!a) return;
			return void

			function c(t, o) {
				n.data.connectionStatus ? a[t](o) : "flash" === n.data.connectionType && setTimeout(function() {
					c(t, o)
				}, 100)
			}(t, o)
		}
		return "ajax" === n.data.connectionType ? void

		function(t, o) {
			var a = {
				uid: n.uinfo.uid,
				uuid: n.uinfo.uuid,
				token: n.uinfo.token,
				type: t
			};
			void 0 !== o && (a.data = decodeURIComponent(o)), e.ajax({
				url: n.data.service + "/push/request",
				data: a,
				type: "GET",
				dataType: "jsonp",
				success: function(t) {
					t && t.data ? n.call(encodeURIComponent(i.stringify(t))) : t && 4003 === t.code && n.showNotice(4003)
				},
				error: function() {
					n.showNotice(6002)
				}
			})
		}(t, o): void 0
	}, {
		connect: function(t) {
			return new a(t)
		}
	}
}(window, document, jQuery, swfobject, JSON);
! function(e, i, t, o) {
	var n = "undefined" != typeof e.MOGU ? e.MOGU : {},
		d = "undefined" != typeof e.MOGUPROFILE ? e.MOGUPROFILE : {},
		u = "undefined" != typeof e.MGTOOL ? e.MGTOOL : {};
	if (void 0 != d && void 0 != d.userid && "" != d.userid) {
		var a = t("head").find("link"),
			s = a.eq(a.length - 1).attr("href"),
			r = +new Date;
		"string" == typeof s && s.indexOf("$") > 0 && (!window.ActiveXObject || window.XMLHttpRequest) && (r = s.split("$")[1].split(".")[0]),
			function() {
				var e, i = d.userid,
					a = d.push_token,
					s = d.push_serviceHost,
					f = d.push_ajaxServiceHost,
					c = d.push_ajaxServiceBakHost;
				e = o.connect({
					serviceHost: s,
					ajaxServiceHost: f,
					ajaxServiceBakHost: c,
					timestamp: r
				}), e.on("data:update", function(e) {
					n.cinfo = e, t("body").trigger("cinfodatarecieve", [e])
				}), e.emit({
					uid: i,
					token: a,
					uuid: u.getCookie("__mgjuuid"),
					mgj: u.getCookie("__ud_"),
					fromsite: u.getCookie("from_site")
				})
			}()
	}
}(window, document, jQuery, window.imio);
! function(t) {
	MOGU.imgCodeCheck = function() {
		var a = !1,
			i = t(".img_code_spin");
		if (0 == i.length) return a = !0;
		for (var c = 0; c < i.length; c++) {
			var e = t(i[c]);
			if (0 != e.val()) {
				a = !0;
				break
			}
		}
		return a
	}, MOGU.imgCaptchaInit = function() {
		var a = t(".imgcheck_image_div"),
			i = t("#imgcheck_code_change"),
			c = function(t, a) {
				var i = -75 * ((a + 1) % 4),
					c = t[0].style.backgroundPosition.split(" ");
				t[0].style.backgroundPosition = c[0] + " " + i + "px"
			};
		a.click(function() {
			var a = t(this).attr("f"),
				i = t("#img_code_spin_" + a),
				e = parseInt(i.val());
			c(t(this), e), i.val(e + 1)
		}), i.click(function() {
			MOGU.imgCaptchaRecaptcha()
		})
	}, MOGU.imgCaptchaRecaptcha = function(a) {
		var i = function(a) {
			for (var i = t(".imgcheck_image_div"), c = i.length, e = 0; c > e; e++) {
				var n = i[e],
					o = n.getAttribute("f"),
					r = t("#img_code_spin_" + o);
				r.val(0);
				var u = t(n);
				u.css("background-image", "url(/captchaimg/" + a + ")"), u.css({
					"background-position": -75 * e + "px 0"
				})
			}
		};
		void 0 === a ? t.ajax({
			url: "/reimgcaptcha",
			type: "POST",
			timeout: 6e4,
			data: {},
			dataType: "json",
			cache: !1,
			success: function(t) {
				var a = t.status.code;
				t.status.msg;
				if (1001 == a) {
					var c = t.result.data.captchaId;
					i(c)
				}
			},
			error: function(t, a, i) {
				"timeout" == a && alert(MGLANG.msgTimeout)
			}
		}) : setTimeout(function() {
			i(a)
		}, 1)
	}, MOGU.imgCaptchaInit()
}(jQuery);
var MOGU = window.MOGU || {};
! function(t, n) {
	var e = {};
	e.Util = {
		mask: function() {
			var n = t(".light_box_fullbg");
			n.length <= 0 && (n = t(['<div class="light_box_fullbg"></div>'].join("")), t("body").append(n))
		},
		show: function(n, e) {
			var l, i, c, o = t("#vp_wrap"),
				a = t(".light_box_fullbg").eq(0);
			o.length <= 0 && (o = t(['<div class="vp_wrap" id="vp_wrap">', '<h5 class="vp_t"></h5>', '<a href="javascript:;" class="vp_cls">×</a>', '<div class="v_pop_box"></div>', "</div>"].join("")), t("body").append(o), a.off("click").on("click", function() {
				clearTimeout(c), o.addClass("vp_shake"), c = setTimeout(function() {
					o.removeClass("vp_shake")
				}, 500)
			})), o.find(".vp_t").html(e.title), i = {
				alert: function() {
					return l = t(".vp_alert"), l.length <= 0 && (l = t(['<div class="vp_alert vp_inner">', '<p class="vp_cnt"></p>', '<a href="javascript:;" class="vp_btn vp_btn_' + e.btn.theme + ' vp_ok">' + e.btn.text + "</a>", "</div>"].join(""))), l.show().find(".vp_cnt").html(e.content), l
				},
				confirm: function() {
					return l = t(".vp_cfm"), l.length <= 0 && (l = t(['<div class="vp_cfm vp_inner">', '<p class="vp_cnt"></p>', '<a href="javascript:;" class="vp_btn vp_btn_' + e.btn1.theme + ' vp_ok">' + e.btn1.text + "</a>", '<a href="javascript:;" class="vp_btn vp_btn_' + e.btn2.theme + ' vp_cancel">' + e.btn2.text + "</a>", "</div>"].join(""))), l.show().find(".vp_cnt").html(e.content), l
				}
			}, o.find(".v_pop_box").append(i[n]()), o.css({
				display: "block",
				opacity: 0
			}).css({
				"margin-left": -o.width() / 2 - 1,
				"margin-top": -o.height() / 2 - 1,
				opacity: 1
			}), a.show()
		},
		close: function(n, e) {
			t(".light_box_fullbg").eq(0).hide(), t("#vp_wrap").find(".vp_inner").hide().end().hide(), void 0 !== e && "function" == typeof e && e(n)
		}
	}, t.alert = function(n, l, i) {
		var c = t.extend(!0, {
				title: "提示",
				content: n,
				btn: {
					text: "确定",
					theme: "red",
					val: void 0
				},
				close_val: void 0
			}, i),
			o = function() {
				t("#vp_wrap").off("click").on("click", ".vp_ok", function(t) {
					t.preventDefault(), e.Util.close(c.btn.val, l)
				}).on("click", ".vp_cls", function(t) {
					t.preventDefault(), e.Util.close(c.close_val, l)
				})
			};
		! function() {
			e.Util.mask(), e.Util.show("alert", c), o()
		}()
	}, t.confirm = function(n, l, i) {
		var c = t.extend(!0, {
				title: "提示",
				content: n,
				btn1: {
					text: "确定",
					theme: "red",
					val: !0
				},
				btn2: {
					text: "取消",
					theme: "normal",
					val: !1
				},
				close_val: !1
			}, i),
			o = function() {
				t("#vp_wrap").off("click").on("click", ".vp_ok", function(t) {
					t.preventDefault(), e.Util.close(c.btn1.val, l)
				}).on("click", ".vp_cancel", function(t) {
					t.preventDefault(), e.Util.close(c.btn2.val, l)
				}).on("click", ".vp_cls", function(t) {
					t.preventDefault(), e.Util.close(c.close_val, l)
				})
			};
		! function() {
			e.Util.mask(), e.Util.show("confirm", c), o()
		}()
	}, n.MOGU.alert = t.alert, n.MOGU.confirm = t.confirm
}(jQuery, window);
! function(t, e, n) {
	e.MOGU = e.MOGU || {};
	var i = {
		init: function() {
			t(document).off(".mga").on("click.mga", '[data-mga="event"]', function(e) {
				return function(n) {
					var i, a, o, r, c;
					return i = t(n.currentTarget), o = i.data("category") || i[0].tagName, a = i.data("action") || n.type, r = i.data("label") || i[0].className, c = i.data("value") || i.html(), e.triggerEvent(o, a, r, c)
				}
			}(this))
		},
		triggerEvent: function(t, e, n, i) {
			var a = this;
			clearTimeout(o);
			var o = setTimeout(function() {
				a.event(t, e, n, i)
			}, 500)
		},
		event: function(e, n, i, a) {
			var o = {
				action: n,
				page: e,
				pos: i
			};
			t.ajax({
				type: "POST",
				url: "http://www.mogujie.com/itemsactionlog",
				data: o,
				success: function(t, e, n) {},
				error: function(t, e, n) {}
			})
		},
		isInScope: function(n) {
			return n.length > 0 && t(e).scrollTop() < n.offset().top + n.outerHeight() && t(e).scrollTop() + t(e).height() > n.offset().top ? !0 : !1
		},
		pageview: function(t, e, n) {
			var i = this;
			clearTimeout(a);
			var a = setTimeout(function() {
				i.isInScope(n) && i.event(t, "view", e, null)
			}, 500)
		}
	};
	i.init(), MOGU.mga = i, "function" == typeof define && define.amd && define.amd.jQuery && define("mga", [], function() {
		return i
	})
}(jQuery, window);
define("template/pc/www/default/assets/js/nav/module/top-nav", [], function() {
	function e() {
		var e = ['<li class="s1 has_icon user_meta haahah">', '<a rel="nofollow" href="javascript:;">', "{{=it.uname}}", "</a>", '<a rel="nofollow" href="http://www.mogujie.com/member" target="_blank">', '<span class="level level', "{{=it.userLevel - 1}}", '">&nbsp;</span>', "</a>", '<i class="icon_delta"></i>', '<ol class="ext_mode" id="menu_personal">', '<li class="s2"><a target="_blank" rel="nofollow" href="http://www.mogujie.com/settings/personal">个人设置</a></li>', '<li class="s2"><a target="_blank" rel="nofollow" href="http://www.mogujie.com/settings/bind">账号绑定</a></li>', '<li class="s2"><a rel="nofollow" href="//www.mogujie.com/logout">退出</a></li>', "</ol>", "</li>", '<li class="s1 has_line message_center">', '<a rel="nofollow" href="javascript:;" class="ext_module mogutalk_btn J_msg open_msg micon __trace__" data-from="shopwidget_message" data-trace="global,shopwidget_message,click">消息<span class="num m_num"></span></a>', "</li>", '<li class="s1 has_icon has_line user_fav">', '<a rel="nofollow" href="javascriot:;">我的收藏</a>', '<i class="icon_delta"></i>', '<ul class="ext_mode">', '<li class="s2"><a target="_blank" rel="nofollow" href="http://www.mogujie.com/active/favs">收藏的商品</a></li>', '<li class="s2"><a target="_blank" rel="nofollow" href="http://www.mogujie.com/active/shopfavs">收藏的小店</a></li>', '<li class="s2"><a target="_blank" rel="nofollow" href="http://www.mogujie.com/active/browserlog">浏览足迹</a></li>', "</ul>", "</li>"].join(""),
			t = ['<li class="s1 show-nologin"><a rel="nofollow" href="http://www.mogujie.com/register/">注册</a></li>', '<li class="s1 show-nologin"><a rel="nofollow" href="http://www.mogujie.com/login/">登录</a></li>'].join(""),
			a = ['<div class="sidebar-item mgj-my-avatar">', '<a target="_blank" href="http://www.mogujie.com/member/" rel="nofollow">', '<div class="img">', '<img width="20" height="20" src="{{=it.avatar}}_48x48.jpg" alt="">', "</div>", "</a>", "</div>"].join(""),
			i = $("#header .header_top"),
			o = $(".mgj_rightbar .mgj-my-cart"),
			s = $(".mgj_rightbar .mgj-my-avatar");
		MOGUPROFILE.uname && MOGUPROFILE.uname.length > 0 ? (i.prepend(MoGu.ui.getTemplate(e, MOGUPROFILE)), i.find(".show-nologin").hide(), MOGUPROFILE.shopFaved && $(".J-shop-follow").addClass("shop-followed").html("已收藏"), MOGUPROFILE.avatar && (s.remove(), $(MoGu.ui.getTemplate(a, MOGUPROFILE)).insertBefore(o))) : i.prepend(MoGu.ui.getTemplate(t, MOGUPROFILE)), MOGUPROFILE.jumpUrl && MOGUPROFILE.jumpUrl.length > 0 && (location.href = MOGUPROFILE.jumpUrl)
	}

	function t() {
		function e(e) {
			var t = new RegExp("(^|&)" + e + "=([^&]*)(&|$)", "i"),
				a = window.location.search.substr(1).match(t);
			return null != a ? unescape(a[2]) : null
		}

		function t(e, t) {
			var a = new Date;
			a.setTime(a.getTime() + 31536e6), document.cookie = e + "=" + escape(t) + ";expires=" + a.toGMTString()
		}

		function a(e) {
			var t, a = new RegExp("(^| )" + e + "=([^;]*)(;|$)");
			return (t = document.cookie.match(a)) ? unescape(t[2]) : null
		}
		var i = $("#menu_personal"),
			o = $(".dapei_tip", i),
			s = $(".dapei_btn", i);
		s.click(function() {
			t("dapei_tip_hidden", !0), o.hide(), setTimeout(function() {
				i.mouseleave(function() {
					$(this).removeClass("ext_mode_show")
				})
			}, 1e3)
		}), null != e("isDaPeiShi") ? i.addClass("ext_mode_show") : "true" == $("#isDaPeiShi").val() && null == a("dapei_tip_hidden") && i.addClass("ext_mode_show")
	}
	window.ESIMOGUPROFILE && e(), t();
	var a = $(".header_2015"),
		i = $(".mgj_rightbar"),
		o = (MoGu.ui.getdoT(), {});
	o.Tpl = {
		headerMsgTpl: []
	}, o.View = {
		init: function() {
			this.addEvent()
		},
		addEvent: function() {
			var e = this;
			$("body").on("cinfodatarecieve", function(t, a) {
				if (a) {
					var i = a,
						o = {};
					o.twitterNew = parseInt(i.cmessageNew), o.catmeNew = parseInt(i.a), o.cfavedNew = parseInt(i.b), o.cmsgNew = parseInt(i.c), o.fansNew = parseInt(i.d), o.csysmsgNew = parseInt(i.e), o.cactiveNew = parseInt(i.f), o.intelligent = parseInt(i.g), o.ccartNew = parseInt(i.h), o.chatNew = parseInt(i.i), o.ccouponShop = parseInt(i.q), o.ccouponPlatform = parseInt(i.j), $.each(e.renders, function(e, t) {
						$.isFunction(t) && t(o)
					})
				}
			})
		},
		renders: {
			renderShopCart: function(e) {},
			renderNavCart: function(e) {
				var t = a.find(".shopping_cart_v2");
				if (t.length)
					if (e.ccartNew) {
						var i = e.ccartNew > 99 ? "99+" : e.ccartNew,
							o = '<span class="cart_info">购物车<b class="num">' + i + "</b>件</span>";
						t.find(".cart_info_wrap").html(o).show()
					} else t.find(".cart_info_wrap").html('<span class="cart_info">购物车</span>')
			},
			renderSideBarCart: function(e) {
				var t = i.find(".mgj-my-cart");
				t.length && (e.ccartNew ? t.find(".num").html(e.ccartNew > 99 ? "99+" : e.ccartNew).show() : t.find(".num").hide())
			},
			renderSideBarCoupon: function(e) {
				var t = i.find(".mgj-my-coupon");
				if (t.length) {
					var a = parseInt(e.ccouponShop + e.ccouponPlatform, 10);
					a ? t.find(".num").html(a > 99 ? "99+" : a).show() : t.find(".num").hide()
				}
			},
			renderNavMsg: function(e) {
				var t = a.find(".mogutalk_btn");
				t.length && (e.chatNew ? t.find(".num").html(e.chatNew > 99 ? "99+" : e.chatNew).show() : t.find(".num").hide())
			}
		}
	}, o.View.init();
	var s = function() {
		this.highClassName = "s1_on"
	};
	s.prototype = {
		add2Collection: function(e) {
			$.browser.msie && 6 == $.browser.version && $.isPlainObject(e) && e.wrap.length && e.target && this._registerEvent(e)
		},
		_registerEvent: function(e) {
			var t = this;
			e.wrap.on("mouseenter", e.target, function(e) {
				$(this).addClass(t.highClassName).siblings().removeClass(t.highClassName)
			}), e.wrap.on("mouseleave", e.target, function(e) {
				$(this).removeClass(t.highClassName)
			})
		}
	}, (new s).add2Collection({
		wrap: $(".header_top"),
		target: ".s1"
	})
}), define("template/pc/www/default/assets/js/nav/module/nav-sidebar", [], function() {
	var e = 1260,
		t = $(".mgj_rightbar"),
		a = {
			goTop: t.find(".mgj-back2top"),
			sidebar: t,
			sidebarCart: t.find(".mgj-my-cart"),
			elePeriod: !1,
			header_mid: $(".header_mid"),
			bodyWrap: $("#body_wrap"),
			shopHeader: $(".shop-header"),
			shopBanner: $(".mod_topBanner"),
			shopBody: $(".shop-main"),
			eleBtn: $(".mgj_rightbar").find(".mgj-my-eleven"),
			eleBack: $(".ele_header_cont").find("i"),
			eleBox: $(".mgj_eleven_box"),
			eleShow: !1,
			eleLoading: $(".ele_body_loading"),
			elePreBox: $(".ele_body_pre"),
			eleFormalBox: $(".ele_body_formal"),
			eleActiveDig: $(".ele_activeDialog"),
			eleActivedDig: $(".ele_activedDialog"),
			eleOffDig: $(".ele_offDialog"),
			eleMask: $(".ele_mask"),
			cartLink: "http://www.mogujie.com/event1111/shopping/index",
			giftLink: "http://www.mogujie.com/event1111/branch/finance",
			presellLink: "http://www.mogujie.com/event1111/branch/yushou",
			gameLink: "http://www.mogujie.com/event1111/index#niudan",
			mainLink: "http://www.mogujie.com/event1111",
			cashLink: "http://www.mogujie.com/trade/promotion/user/cashcoupon",
			shopLink: "http://www.mogujie.com/trade/promotion/user/shopcoupon",
			couponsLink: "http://www.mogujie.com/trade/promotion/user/cashcoupon",
			cartNumLink: "http://www.mogujie.com/trade/cart/mycart",
			retainageLink: "http://www.mogujie.com/trade/order/list4buyer?stage=1",
			flashBuyLink: "http://www.mogujie.com/event1111/branch/finance",
			timeSplit: 1447084800,
			cartTime: 1446825600,
			giftTime: 1447084800,
			gameTimeS: 1446825600,
			gameTimeE: 1447344e3,
			tpl_pre: ['<div class="ele_pre_task" style="background:url(', "{{ if(it.time < it.obj.cartTime){ }}", "images/upload_ie3timtbg44dmzrzgqzdambqgayde_230x546.jpg", "{{ }else{ }}", "images/upload_ifqtsnlemq3tmzrzgqzdambqgyyde_230x546.jpg", "{{ } }}", ') no-repeat;">', '<div class="title"><span><i></i>双十一任务</span></div>', '<a class="cart link" ', "{{ if(it.time >= it.obj.cartTime){ }}", 'href="javascript:void(0)" onClick="return false;"', "{{ }else{ }}", 'href="{{=it.obj.cartLink}}"', '{{ } }} target="_blank" rel="nofollow">', '<img class="', "{{ if(it.time < it.obj.cartTime){ }}", "hidden", '{{ } }}"', 'src="images/upload_iezwmnzrgvtgcmdegmzdambqgyyde_199x84.png">', "</a>", '<a class="gift link" href="{{=it.obj.giftLink}}" target="_blank" rel="nofollow" ></a>', '<a class="game link"', "{{ if(it.time < it.obj.gameTimeS){ }}", 'href="{{=it.obj.presellLink}}"', "{{ }else{ }}", 'href="{{=it.obj.gameLink}}"', '{{ } }} target="_blank"  rel="nofollow">', "</a>", '<a class="machine link ', "{{ if(!it.data.tmEnabled){ }}", "activeTM", "{{ }else{ }}", "activedTM", "{{  } }}", '" href="javascript:void(0)" onClick="return false;" target="_blank"  rel="nofollow">', '<img class="activeImg ', "{{ if(!it.data.tmEnabled){ }}", "hidden", "{{ } }}", '" src="images/upload_ie2wgzdbgnrtsztfgmzdambqhayde_199x84.png">', "</a>", '<a id="tmHref" href="http://shop.mogujie.com/detail/181eglq" target="_blank" rel="nofollow"></a>', "</div>", '<div class="ele_pre_coupus">', '<div class="coupons_title"><span><i></i>我的券</span></div>', '<a class="cashCoupon" href="', "{{ if(it.data.cashCoupons.getCount == 0 || it.data.cashCoupons.getCount == null){ }}", "{{=it.obj.mainLink}}", "{{ }else{ }}", "{{=it.obj.cashLink}}", "{{ } }}", '" target="_blank"  rel="nofollow" style="text-decoration:none">', '<span class="title"><b>全场现金券</b>></span>', '<span class="few">已领取<b>{{=it.data.cashCoupons.getCount}}</b>张</span>', "{{ if(it.data.cashCoupons.getCount == 0 || it.data.cashCoupons.getCount == null){ }}", '<span class="money">去主会场抢券</span>', "{{ }else{ }}", '<span class="money">约节省<b>{{=it.data.cashCoupons.money}}</b>元</span>', "{{ } }}", "</a>", '<a class="coupons" href="', "{{ if(it.data.shopCoupons.getCount == 0 || it.data.shopCoupons.getCount == null){ }}", "{{=it.obj.mainLink}}", "{{ }else{ }}", "{{=it.obj.shopLink}}", "{{ } }}", '" target="_blank"  rel="nofollow" style="text-decoration:none">', '<span class="title"><b>店铺优惠券</b>></span>', '<span class="few">已领取<b>{{=it.data.shopCoupons.getCount}}</b>张</span>', "{{ if(it.data.shopCoupons.getCount == 0 || it.data.shopCoupons.getCount == null){ }}", '<span class="money">去主会场抢券</span>', "{{ }else{ }}", '<span class="money">约节省<b>{{=it.data.shopCoupons.money}}</b>元</span>', "{{ } }}", "</a></div>"].join(""),
			tpl_formal: ['<div class="ele_formal_record">', '<div class="title"><span><i></i>我的战绩</span></div>', '<a class="record_coupons record_notice" href="', "{{ if(it.data.coupons < 1){ }}", "{{=it.obj.mainLink}}", "{{ }else{ }}", "{{=it.obj.couponsLink}}", "{{ } }}", '" target="_blank" rel="nofollow" style="text-decoration:none">', '<p class="notice_title">剩下现金券</p>', "{{ if(it.data.coupons == 0 ){ }}", '<p class="notice_count"><b>0</b> 张</p>', '<p class="notice_btn">去领券 ></p>', "{{ }else if(it.data.coupons == -1 ){ }}", '<p class="notice_count compute">计算中...</p>', '<p class="notice_btn">去领券 ></p>', "{{ }else{ }}", '<p class="notice_count"><b>{{=it.data.coupons}}</b> 张</p>', '<p class="notice_btn">点击查看 ></p>', "{{ } }}", "</a>", '<a class="record_shop record_notice"  href="', "{{ if(it.data.itemsInCart < 1){ }}", "{{=it.obj.mainLink}}", "{{ }else{ }}", "{{=it.obj.cartNumLink}}", "{{ } }}", '" target="_blank" rel="nofollow" style="text-decoration:none">', '<p class="notice_title">购物车还剩商品</p>', "{{ if(it.data.itemsInCart == 0){ }}", '<p class="notice_count"><b>0</b> 件</p>', '<p class="notice_btn">去逛逛 ></p>', "{{ }else if(it.data.itemsInCart == -1){ }}", '<p class="notice_count compute">计算中...</p>', '<p class="notice_btn">去逛逛 ></p>', "{{ }else{ }}", '<p class="notice_count"><b>{{=it.data.itemsInCart}}</b> 件</p>', '<p class="notice_btn">点击查看 ></p>', "{{ } }}", "</a>", '<div class="record_time"><span>以下数据今日{{=it.data.updateTime}}更新</span></div>', '<div class="record_consume record_rank" >', '<p class="rank_title">已消费</p>', "{{ if(it.data.buyFee.rate == 100){ }}", '<p class="rank_count"><b>{{=Math.floor(it.data.buyFee.amount/100)}}</b>.', "{{if((it.data.buyFee.amount%100)<10)}}", "0{{=(it.data.buyFee.amount%100)}}", "{{ else{}}", "{{=(it.data.buyFee.amount%100)}}", "{{ } }}", " 元</p>", '<p class="rank_info"><i></i> 打败同城所有对手了</p>', "{{ }else{ }}", '<p class="rank_count"><b>{{=Math.floor(it.data.buyFee.amount/100)}}</b>.', "{{if((it.data.buyFee.amount%100)<10)}}", "0{{=(it.data.buyFee.amount%100)}}", "{{ else{}}", "{{=(it.data.buyFee.amount%100)}}", "{{ } }}", " 元</p>", '<p class="rank_info">打败同城{{=it.data.buyFee.rate}}%的对手</p>', "{{ } }}", "</div>", '<div class="record_buyItem record_rank" >', '<p class="rank_title">已购买商品</p>', "{{ if(it.data.buyItem.rate == 100){ }}", '<p class="rank_count"><b>{{=it.data.buyItem.amount}}</b> 件</p>', '<p class="rank_info"><i></i> 打败同城所有对手了</p>', "{{ }else{ }}", '<p class="rank_count"><b>{{=it.data.buyItem.amount}}</b> 件</p>', '<p class="rank_info">打败同城{{=it.data.buyItem.rate}}%的对手</p>', "{{ } }}", "</div>", '<div class="record_winFee record_rank">', '<p class="rank_title">约节省</p>', "{{ if(it.data.winFee.rate == 100){ }}", '<p class="rank_count"><b>{{=it.data.winFee.amount}}</b> 元</p>', '<p class="rank_info"><i></i> 打败同城所有对手了</p>', "{{ }else{ }}", '<p class="rank_count"><b>{{=it.data.winFee.amount}}</b> 元</p>', '<p class="rank_info">打败同城{{=it.data.winFee.rate}}%的对手</p>', "{{ } }}", "</div>", "</div>", '{{ if(typeof(it.data.presellItems) != "undefined" && it.data.presellItems !=null && it.data.presellItems.length !=0 ){ }}', '<div class="ele_formal_sell">', '<div class="sell_header">', '<span class="header_title"><i></i>预售尾款提醒</span>', '<span class="header_btn">全部<i></i></span>', '<span class="header_btn_hidden ">收起<i></i></span>', "</div>", '<ul class="sell_box">', "{{~it.data.presellItems:item:index}}", '<li class="', "{{ if(index > 2){}}", "hidden item_hidden", '{{ } }}">', '<a class="item_icon" href="http://shop.mogujie.com/detail/{{=item.itemId}}" target="_blank" rel="nofollow">', '<img src="{{=item.image}}_100x100.jpg" alt="{{=item.title}}">', "</a>", '<div class="item_info">', '<a class="info_atitle" href="http://shop.mogujie.com/detail/{{=item.itemId}}" target="_blank" rel="nofollow"><p class="info_title">{{=item.title}}</p></a>', '<p class="info_price">￥{{=item.price/100}}</p>', '<a href="{{=it.obj.retainageLink}}" target="_blank" rel="nofollow"><div class="info_btn"><span>去付尾款</span></div></a>', "</div>", "</li>", "{{~}}", "</ul>", '<div class="sell_footer">', '<div class="dot"><i></i></div><span>请在11月12日24:00之前支付 尾款，否则交易不成立并且定 金不退还</span>', "</div>", "</div>", "{{ } }}", '<div class="ele_formal_flash">', '<div class="flash_header">', '<span class="header_title"><i></i>一分钱抢百元红包</span>', "</div>", '<a class="flash_box" href="{{=it.obj.flashBuyLink}}" target="_blank"  rel="nofollow">', '<img src="http://s18.mogucdn.com/p1/151008/upload_ie2tsmzsgyztqzjrgqzdambqhayde_230x149.jpg">', "</a>", "</div>"].join(""),
			init: function() {
				if ("Microsoft Internet Explorer" == navigator.appName && "MSIE6.0" == navigator.appVersion.split(";")[1].replace(/[ ]/g, "")) return void $(".mgj_rightbar").hide();
				var e = 0,
					t = this.GetRequest().t;
				e = t ? t : Math.round((new Date).getTime() / 1e3), e > 1446307200 && 1447344e3 > e && (this.elePeriod = !0), this.sidebar.show(), this.goTop.length && (this.offsetEl = $(".wrap").length ? $(".wrap").eq(0) : $("#body_wrap"), this.offsetEl.length && (this.win = $(window), this.setSidebarPos(), this.addEvent()))
			},
			addEvent: function() {
				var t = this;
				this.win.on("resize", function(e) {
					t.setSidebarPos()
				}), this.sidebarCart.off().on("mouseenter", function() {
					t.win.width() > e || t.eleShow || t.showSidebar()
				}), this.sidebar.off().on("mouseleave", function() {
					t.win.width() > e || t.eleShow || t.hideSidebar()
				}), this.win.on("scroll", function(e) {
					$(this).scrollTop() ? t.goTop.addClass("show") : t.goTop.removeClass("show")
				}), this.goTop.on("click", function(e) {
					return t.win.scrollTop(0), !1
				}), this.eleBtn.on("click", "a", function() {
					if (MOGUPROFILE.userid) {
						var a = $(".mgj-my-eleven").attr("data-show");
						if (1 == a) t.sidebar.stop().animate({
							right: "0"
						}), t.eleBox.stop().animate({
							right: "-230"
						}), $(".mgj-my-eleven").attr("data-show", "0"), t.win.width() < e && (t.eleShow = !1, t.hideSidebar());
						else {
							t.sidebar.stop().animate({
								right: "230"
							}), t.eleBox.stop().animate({
								right: "0"
							}), t.win.width() < e && (t.eleShow = !0), $(".mgj-my-eleven").attr("data-show", "1");
							var i = MoGu.ui.getdoT();
							if (!i) return;
							var o = 0,
								s = t.GetRequest().t;
							o = s ? s : Math.round((new Date).getTime() / 1e3), o < t.timeSplit ? $.ajax({
								url: "http://www.mogujie.com/x6/member/my201511/warmup",
								dataType: "jsonp",
								jsonp: "callback",
								jsonpCallback: "success_jsonpCallback",
								type: "GET",
								success: function(e) {
									var a = e.status.code;
									if (1001 == a) {
										var s = e.result;
										t.eleLoading.hide(), t.elePreBox.show();
										var n = i.template(t.tpl_pre)({
											data: s,
											time: o,
											obj: t
										});
										t.elePreBox.empty(), t.elePreBox.append(n), $(".ele_pre_task").on("click", ".activeImg", function() {
											t.eleActivedDig.show(), t.eleMask.show()
										}), $(".ele_pre_task").on("click", ".activeTM", function() {
											1447041600 > o ? $.ajax({
												url: "http://www.mogujie.com/x6/member/my201511/enabletm",
												dataType: "jsonp",
												jsonp: "callback",
												jsonpCallback: "success_jsonpCallback",
												type: "GET",
												success: function(e) {
													var a = e.status.code;
													1001 == a && (e.result ? (t.eleActiveDig.show(), t.eleMask.show()) : window.location.href = "http://shop.mogujie.com/detail/181eglq")
												},
												error: function(e) {
													console.log("error", e)
												}
											}) : (t.eleOffDig.show(), t.eleMask.show())
										}), $(".ele_activeDialog").on("click", ".close , .btn", function() {
											t.eleActiveDig.hide(), t.eleMask.hide(), $(".activeImg").removeClass("hidden"), $(".machine").removeClass("activeTM")
										}), $(".ele_activedDialog").on("click", ".close , .btn", function() {
											t.eleActivedDig.hide(), t.eleMask.hide()
										}), $(".ele_offDialog").on("click", ".close , .btn", function() {
											t.eleOffDig.hide(), t.eleMask.hide()
										})
									}
								},
								error: function(e) {
									console.log("error", e)
								}
							}) : $.ajax({
								url: "http://www.mogujie.com/x6/member/my201511/official",
								dataType: "jsonp",
								jsonp: "callback",
								jsonpCallback: "success_jsonpCallback",
								type: "GET",
								success: function(e) {
									var a = e.status.code;
									if (1001 == a) {
										var s = e.result;
										t.eleLoading.hide(), t.eleFormalBox.show();
										var n = i.template(t.tpl_formal)({
											data: s,
											time: o,
											obj: t
										});
										t.eleFormalBox.empty(), t.eleFormalBox.append(n), $(".sell_header").on("click", ".header_btn", function() {
											$(".item_hidden").removeClass("hidden"), $(this).hide(), $(".sell_header .header_btn_hidden").show()
										}), $(".sell_header").on("click", ".header_btn_hidden", function() {
											$(".item_hidden").addClass("hidden"), $(this).hide(), $(".sell_header .header_btn").show()
										})
									}
								},
								error: function(e) {
									console.log("error", e)
								}
							})
						}
						return !1
					}
				});
				var a = 0;
				this.elePreBox.bind("mousewheel DOMMouseScroll", function(e) {
					var t = $(this).scrollTop(),
						i = t - a;
					a = t, 0 >= i && 100 > a && $(this).scrollTop(a + 1), i >= 0 && a > 100 && $(this).scrollTop(a - 1)
				}), this.eleFormalBox.bind("mousewheel DOMMouseScroll", function(e) {
					var t = $(this).scrollTop(),
						i = t - a;
					a = t, 0 >= i && 100 > a && $(this).scrollTop(a + 1), i >= 0 && a > 100 && $(this).scrollTop(a - 1)
				}), this.eleBack.add(this.bodyWrap).add(this.header_mid).add(this.shopHeader).add(this.shopBanner).add(this.shopBody).on("click", function() {
					1 == t.eleBtn.attr("data-show") && (t.sidebar.stop().animate({
						right: "0"
					}), t.eleBox.stop().animate({
						right: "-230"
					}), t.eleBtn.attr("data-show", "0"), t.win.width() < e && (t.eleShow = !1, t.hideSidebar()))
				})
			},
			setSidebarPos: function() {
				var t = (this.offsetEl.offset(), this.offsetEl.outerWidth(), this.win.width());
				e > t ? this.hideSidebar() : this.showSidebar()
			},
			showSidebar: function() {
				this.sidebarCart.stop().animate({
					left: "0"
				}), this.goTop.stop().animate({
					left: "0"
				}), this.sidebar.removeClass("mini").stop().animate({
					right: "0"
				}), this.eleBox.stop().animate({
					right: "-230"
				}), this.eleBtn.attr("data-show", "0")
			},
			hideSidebar: function() {
				this.elePeriod ? (this.sidebarCart.stop().animate({
					left: "-78px"
				}), this.goTop.stop().animate({
					left: "-78px"
				}), this.sidebar.addClass("mini").stop().animate({
					right: "-78px"
				})) : (this.sidebarCart.stop().animate({
					left: "-30px"
				}), this.goTop.stop().animate({
					left: "-30px"
				}), this.sidebar.addClass("mini").stop().animate({
					right: "-30px"
				})), this.eleBox.stop().animate({
					right: "-230"
				}), this.eleBtn.attr("data-show", "0")
			},
			GetRequest: function() {
				var e = location.search,
					t = new Object;
				if (-1 != e.indexOf("?")) {
					var a = e.substr(1);
					strs = a.split("&");
					for (var i = 0; i < strs.length; i++) t[strs[i].split("=")[0]] = strs[i].split("=")[1]
				}
				return t
			}
		};
	a.init()
}), define("template/pc/www/default/assets/js/nav/module/cart", [], function() {
	var e = {};
	e.Model = {
		goodsList: "",
		goodsNum: 0,
		getGoodsList: function(e) {
			var t = this;
			return t.goodsList ? void($.isFunction(e) && e(this.goodsList)) : void $.post("/trade/cart/shoptopcart?isnew=1", {}, function(a) {
				1001 == a.status.code && (t.goodsList = a.result.html, t.goodsNum = a.result.count || 0, $.isFunction(e) && e(t.goodsList))
			}, "json")
		},
		delGood: function(e, t) {
			$.post("/trade/cart/delete", {
				stockid: e
			}, function(e) {
				1001 == e.status.code ? $.isFunction(t) && t() : alert(e.status.msg)
			}, "json")
		}
	}, e.View = {
		wrap: $(".header_2015 .shopping_cart_v2"),
		init: function() {
			this.wrap.length && (this.extendInfo = null, this.loading = this.wrap.find(".shopping_cart_loading"), this.maxShowNum = 5, this.addEvent())
		},
		addEvent: function() {
			var t = this;
			t.wrap.on("mouseenter", function(a) {
				var i = $(this);
				i.addClass("sc_on"), t.loading.show(), t.extendInfo && t.extendInfo.length ? (t.loading.hide(), t.extendInfo.show()) : e.Model.getGoodsList(function(e) {
					t.extendInfo = $(e);
					var a = t.extendInfo.find("li");
					a.length > t.maxShowNum && a.slice(t.maxShowNum, a.length).remove(), i.append(t.extendInfo), t.loading.hide(), t.extendInfo.show()
				})
			}), t.wrap.on("mouseleave", function(e) {
				t.extendInfo && t.extendInfo.hide() && $(this).removeClass("sc_on")
			}), t.wrap.on("click", ".del", function() {
				var a = $(this),
					i = a.data("stockid"),
					o = (t.wrap.find(".num"), a.parent()),
					s = e.Model.goodsNum;
				e.Model.delGood(i, function() {
					s--, o.fadeOut("slow", function() {
						s ? (o.remove(), e.Model.goodsNum = s) : t.extendInfo.addClass("empty_cart").text("购物车里没有商品！")
					})
				})
			})
		}
	}, e.View.init()
}), define("template/pc/www/default/assets/js/nav/module/back2top", [], function() {
	var e = {
		wrap: $(".back2top_wrap"),
		init: function() {
			this.wrap.length && (this.offsetEl = $(".wrap").length ? $(".wrap").eq(0) : $("#body"), this.offsetEl.length && (this.win = $(window), this.goTop = this.wrap.find(".go_top"), this.setPos(), this.wrap.show(), this.addEvent()))
		},
		addEvent: function() {
			var e = this;
			this.win.on("resize", function(t) {
				e.setPos()
			}), this.win.on("scroll", function(t) {
				$(this).scrollTop() ? e.goTop.addClass("show") : e.goTop.removeClass("show")
			}), this.goTop.on("click", function(t) {
				return e.win.scrollTop(0), !1
			})
		},
		setPos: function() {
			var e = this.offsetEl.offset(),
				t = this.offsetEl.outerWidth(),
				a = this.win.width(),
				i = this.wrap.width(),
				o = 15,
				s = e.left + t + 20;
			i + s + o > a ? this.wrap.css({
				left: "auto",
				right: o
			}) : this.wrap.css({
				left: s,
				right: "auto"
			})
		}
	};
	e.init()
}), require(["template/pc/www/default/assets/js/nav/module/top-nav", "template/pc/www/default/assets/js/nav/module/nav-sidebar", "template/pc/www/default/assets/js/nav/module/cart", "template/pc/www/default/assets/js/nav/module/back2top"], function() {});
define("template/pc/www/default/assets/js/header/module/search", [], function() {
	function t(t, e) {
		this.init(t, e)
	}

	function e() {
		function t(t) {
			return $.trim(t).replace(/(<|>|'|"|window|alert|eval|$|jQuery)/gi, "")
		}
		r.on("keyup keydown", function(n) {
			var s = $(this),
				i = $("#select_type");
			if (!i.length || "bao" === i.val() || "5" === i.val()) switch (n.keyCode) {
				case 40:
					if ("keyup" == n.type || !o.data("isshow")) break;
					f.chooseIndex = f.chooseIndex + 1 > f.tipLength - 1 ? 0 : ++f.chooseIndex;
					var l = m.changeListTab(f.chooseIndex);
					r.val(l);
					break;
				case 38:
					if ("keyup" == n.type || !o.data("isshow")) break;
					f.chooseIndex = f.chooseIndex - 1 < 0 ? f.tipLength - 1 : --f.chooseIndex;
					var l = m.changeListTab(f.chooseIndex);
					r.val(l);
					break;
				case 13:
					if ("keyup" == n.type) break;
					n.preventDefault(), e.submitBefore(f.chooseType, f.chooseIndex), c.submit();
					break;
				case 37:
					break;
				case 39:
					break;
				default:
					clearTimeout(a), a = setTimeout(function() {
						var e = t(s.val());
						m.resetFactory(e)
					}, 500)
			}
		}).on("focus", function() {
			var e = $(this),
				n = $("#select_type");
			if (a && clearTimeout(a), !n.length || "bao" === n.val() || "5" === n.val()) {
				var s = t(e.val());
				clearTimeout(a), a = setTimeout(function() {
					m.resetFactory(s)
				}, 300)
			}
		}).on("blur", function() {
			$("body").bind("click", function(t) {
				$(t.target).parents(".seatch_type_msearch").length || (o.empty().data("isshow", !0).hide(), $("body").unbind("click"))
			})
		}), o.on("mouseenter", ".search_tip li", function(t) {
			var e = $(this),
				n = e.index();
			f.chooseIndex = n, m.changeListTab(n)
		}).on("click", ".search_tip li", function(t) {
			var n = $(this).find(".title").text();
			$(t.target).hasClass("prop") && (n += " " + $(t.target).text()), e.submitBefore(f.chooseType, f.chooseIndex), r.val(n), c.submit()
		}), o.on("click", ".hot_list li", function() {
			var t = $(this);
			return e.submitBefore(m.hotTypeName, t.index()), r.val(t.find("span").html()), c.submit(), !1
		}), o.on("click", ".local_del", function(t) {
			var e = $(this),
				n = e.parent();
			d.del(n.find(".title").attr("title"));
			var s = d.getTenItem();
			return m.updateLocalContent(e, s), f.chooseIndex = -1, f.tipLength = s.length, !1
		}).on("click", ".local_title .del_all", function() {
			var t = $(this);
			return d.set(), m.destoryLocalContent(t), t.remove(), f.chooseIndex = -1, f.tipLength = 0, !1
		}), i.on("click", ".selectbox a", function(t) {
			t.preventDefault(), m.changeType($(this))
		}).on("mouseenter", ".selectbox", function() {
			o.hide(), $(this).addClass("sele_hover")
		}).on("mouseleave", ".selectbox", function() {
			$(this).removeClass("sele_hover")
		}), c.submit(function() {
			var n = $(this),
				s = t(r.val()),
				i = r.attr("def-v");
			if ("" == s || s == i) {
				if ("" == s && "shop" == $("#select_type").val()) return !1;
				var a = r.data("def");
				r.val(a || "");
				var o = '<input type="hidden" name="from" value="searchplacehold" id="TJ">';
				$("#top_nav_form").append(o), setTimeout(function() {
					$("#TJ").remove()
				}, 1e3)
			} else s == $.trim(r.val()) && "bao" == $("#select_type").val() && d.addOne(s);
			if (c.find(".emptyvalue").remove(), n.data("index") > -1 && null !== n.data("type")) {
				var l = '<input type="hidden" class="emptyvalue" name="from" value="' + n.data("type") + "querytip" + n.data("index") + '">';
				c.append(l)
			}
			m.destoryContent(), e.submitAfter()
		}), m.showStickySearch() && m.initStickySearch()
	}
	var n = MoGu.ui.getdoT(),
		s = MoGu.util.getStore();
	if (n && s) {
		$(".store_header").length;
		var i = $("#nav_search_form");
		if (i.length) {
			var a, o = $(".top_search_hint"),
				r = i.find(".ts_txt"),
				c = $("#top_nav_form"),
				l = $("#select_type"),
				h = i.find(".selectbox"),
				p = "/msearch/tips/item",
				u = {
					nowHost: window.location.host,
					defultHost: "http://www.mogujie.com",
					template: '<div class="search_tip_box fl">{{=it.searchResult}}</div>',
					listItemTemp: ['<div class="mr300 tip_wrap">', '{{ if(it.titleName && it.titleName != ""){ }}', '<h3 class="search_tip_title">{{=it.titleName}}</h3>', "{{ }else{ }}", "{{ } }}", '<ul class="search_tip">', "{{~it.items :item:index}}", "{{ if(index < 10){ }}", "<li>", '<a href="javascript:;" class="title" title="{{= item.title }}" >{{= item.title }}</a>', "{{~item.props :prop: i}}", '<span class="prop">{{= prop }}</span>', "{{~}}", "</li>", "{{ } }}", "{{~}}", "</ul>", "</div>"].join(""),
					localItemTemp: ['<div class="mr300 tip_wrap">', '<h3 class="search_tip_title local_title clearfix">', "{{ if(it.items.length){ }}", '<span class="del_all">删除</span>', "{{ } }}", "历史记录", "</h3>", '<ul class="search_tip">', "{{~it.items :item:index}}", "{{ if(index < 10){ }}", '<li class="local_item">', '<a href="javascript:;" class="title" title="{{=item}}" >{{=item}}</a>', "{{~item.props :prop: i}}", '<span class="prop">{{= prop }}</span>', "{{~}}", '<span class="nums local_del">x</span>', "</li>", "{{ } }}", "{{~}}", "</ul>", "</div>"].join(""),
					hotKeyTpl: ['<div class="search_hot_wrap">', '<h3 class="search_tip_title hot_title">热门关键词</h3>', '<ul class="hot_list clearfix">', "{{~it.items :item:index}}", "{{ if(index < 10){ }}", "<li><span>{{= item.title }}</span></li>", "{{ } }}", "{{~}}", "</ul>", "</div>"].join(""),
					emptyTpl: ['<div class="mr300 tip_wrap">', '<p class="tip_none">暂无相关热门关键词</p>', "</div>"].join("")
				},
				d = {
					keyName: "_search_local_history",
					keyShowName: "_search_local_history_show",
					maxLength: 20,
					showLength: 10,
					isshow: function() {
						return !0
					},
					abtest: function(t) {
						s.set(this.keyShowName, 1)
					},
					get: function() {
						return s.get(this.keyName) || []
					},
					getTenItem: function() {
						var t = this.get();
						return t.slice(0, this.showLength)
					},
					set: function(t) {
						s.set(this.keyName, t || [])
					},
					addOne: function(t) {
						if (t = $.trim(t), "" != t) {
							var e = this.get(),
								n = $.inArray(t, e); - 1 == n ? (e.unshift(t), e.length > this.maxLength && e.pop()) : (e.splice(n, 1), e.unshift(t)), this.set(e)
						}
					},
					del: function(t) {
						t = $.trim(t);
						var e = this.get(),
							n = $.inArray(t, e);
						n > -1 && (e.splice(n, 1), this.set(e))
					}
				};
			t.prototype.init = function(t, e) {
				this.chooseIndex = -1, this.chooseType = t, this.tipLength = e || 0
			};
			var f = new t("undefined"),
				m = {
					ajaxRequest: null,
					hotKeyArr: [],
					isShopHost: function() {
						return !1
					},
					showStickySearch: function() {
						var t = location.pathname,
							e = $(".mgj_primary"),
							n = e.length > 0 ? e.offset().top + e.height() : 10;
						return "www.mogujie.com" === location.host && ("/" === t || "/more" === t) || t.indexOf("/book/search/") > -1 || /webdemo || localhost/.test(location.host) && /sticky/.test(location.search) ? (t.indexOf("/book/search/") > -1 && (e = $(".search_filter_wrap"), n = e.length ? e.offset().top : 150), this.stickyTargetTop = n, !0) : !1
					},
					resetFactory: function(t) {
						this.isShopHost() ? this.resetShopContent(t) : d.isshow() ? this.resetListContent(t) : this.resetOldContent(t)
					},
					resetListContent: function(e) {
						function s(t) {
							i(function() {
								a()
							})
						}

						function i(n) {
							r.ajaxRequest && r.ajaxRequest.abort();
							var s = d.getTenItem();
							return "" == $.trim(e) ? (c.push(r.renderLocalContent(s)), void($.isFunction(n) && n())) : void(r.ajaxRequest = $.post(p, {
								input: e
							}, function(e) {
								if (e && 1001 == e.status.code) {
									var s = e.result.tipCount;
									0 == s ? c.push(r.renderEmptyContent()) : (c.push(r.renderSearchContent(e.result.tips, e.result.nums, e.result.props)), f = new t(r.searchTypeName, s))
								}
								$.isFunction(n) && n()
							}, "json"))
						}

						function a() {
							var t = n.template(u.template)({
								searchResult: c.join("")
							});
							o.html(t), r.showContentBox()
						}
						var r = this,
							c = [];
						r.hotKeyArr.length ? s(r.hotKeyArr) : $.post(p, {}, function(t) {
							r.hotKeyArr = t.result.tips, s(r.hotKeyArr)
						}, "json")
					},
					resetShopContent: function(e) {
						function s(n) {
							a.ajaxRequest && a.ajaxRequest.abort(), a.ajaxRequest = $.post(p, {
								input: e
							}, function(e) {
								if (e && 1001 == e.status.code) {
									var s = e.result.tipCount;
									0 == s ? r.push(a.renderEmptyContent()) : (r.push(a.renderSearchContent(e.result.tips, e.result.nums, e.result.props, c)), f = new t(l, s))
								}
								$.isFunction(n) && n()
							}, "json")
						}

						function i() {
							var t = n.template(u.template)({
								searchResult: r.join("")
							});
							o.html(t), a.showContentBox()
						}
						var a = this,
							r = [],
							c = "",
							l = "" != e ? a.searchTypeName : a.hotTypeName;
						s(function() {
							i()
						})
					},
					resetOldContent: function(e) {
						function s(n) {
							a.ajaxRequest && a.ajaxRequest.abort(), a.ajaxRequest = $.post(p, {
								input: e
							}, function(e) {
								if (e && 1001 == e.status.code) {
									var s = e.result.tipCount;
									0 == s ? r.push(a.renderEmptyContent()) : (r.push(a.renderSearchContent(e.result.tips, e.result.nums, c)), f = new t(l, s))
								}
								$.isFunction(n) && n()
							}, "json")
						}

						function i() {
							var t = n.template(u.template)({
								searchResult: r.join("")
							});
							o.html(t), o.find(".tip_wrap").removeClass("mr300").addClass("mr300_fix"), a.showContentBox()
						}
						var a = this,
							r = [],
							c = "" != e ? "搜索结果" : "热门关键词",
							l = "" != e ? a.searchTypeName : a.hotTypeName;
						s(function() {
							i()
						})
					},
					searchTypeName: "",
					renderSearchContent: function(t, e, s, i) {
						for (var a = [], o = 0; o < t.length; o++) a.push({
							title: t[o],
							props: s[o],
							num: e[o]
						});
						return n.template(u.listItemTemp)({
							titleName: i || null,
							items: a
						})
					},
					localTypeName: "local",
					renderLocalContent: function(t) {
						return n.template(u.localItemTemp)({
							items: t
						})
					},
					updateLocalContent: function(t, e) {
						var n = t.parent(),
							s = t.parents(".search_tip");
						if (n.length && s.length)
							if (e.length < d.showLength) n.remove();
							else {
								var i = e[d.showLength - 1];
								n.find(".title").attr("title", i).html(i), n.appendTo(s)
							}
					},
					destoryLocalContent: function(t) {
						var e = t.parents(".tip_wrap").find(".search_tip");
						e.length && e.empty()
					},
					hotTypeName: "default",
					renderHotContent: function(t) {
						for (var e = [], s = 0; s < t.length; s++) e.push({
							title: t[s]
						});
						return n.template(u.hotKeyTpl)({
							items: e
						})
					},
					renderEmptyContent: function() {
						return u.emptyTpl
					},
					destoryContent: function() {
						o.empty().hide()
					},
					getContentPosition: function(t, e) {
						var n = e.offset(),
							s = t.data("fixleft"),
							i = t.data("fixtop");
						s && (n.left += parseInt(s)), i && (n.top -= parseInt(i));
						var a = e.width() - 34;
						t.css({
							left: n.left,
							top: n.top + e.height() + 2,
							width: a
						}).addClass("hasposition")
					},
					showContentBox: function() {
						o.show().data("isshow", !0)
					},
					changeListTab: function(t) {
						var e = o.find(".search_tip li"),
							n = e.eq(t);
						return e.removeClass("checked"), n.addClass("checked"), n.find(".title").text()
					},
					changeType: function(t) {
						var e = t.parent(),
							n = e.attr("data-index"),
							s = t.text();
						if (l.val(n), h.find(".selected").text("搜" + s), e.siblings("li").removeClass("current"), e.addClass("current"), "shop" == n) r.val() == r.attr("def-v") && r.val("");
						else if ("" == r.val()) {
							var i = r.attr("def-v");
							r.val(i)
						}
						4 == n ? "shop.mogujie.com" === u.nowHost ? c.attr("action", u.defultHost + "/group/search/") : c.attr("action", "/group/search/") : "shop.mogujie.com" === u.nowHost ? c.attr("action", u.defultHost + "/search") : c.attr("action", "/search/"), h.removeClass("sele_hover")
					},
					initStickySearch: function() {
						var t = $("#nav_search_form"),
							e = ['<div id="J_sticky_container" class="sticky-search-container">', '<div class="wrap">', '<a rel="nofollow" href="http://www.mogujie.com" class="logo" title="蘑菇街|我的买手街">蘑菇街|我的买手街</a>', '<div class="sticky-search-content"></div>', "</div>", "</div>"].join("");
						$("body").append(e);
						var n = $(".sticky-search-container");
						$(window).off("scroll.sticky").on("scroll.sticky", function() {
							$(document).scrollTop() > m.stickyTargetTop ? n.hasClass("lets-rock") || n.find(".sticky-search-content").append(t).end().addClass("lets-rock") : n.hasClass("lets-rock") && ($(".normal-search-content").append($("#nav_search_form")), n.find(".sticky-search-content").empty().end().removeClass("lets-rock"))
						})
					}
				};
			e.submitBefore = function(t, e) {
				c.data({
					type: t,
					index: e
				})
			}, e.submitAfter = function() {
				c.removeData("type index"), f.chooseType = "undefined", f.chooseIndex = -1
			};
			var v = function() {
				MoGu.util.inputTextHide(r, "ts_high"), "www.mogujie.com" === u.nowHost || h.parents(".store_header").length || c.attr("action", u.defultHost + c.attr("action")), e()
			};
			v()
		}
	}
}), require(["template/pc/www/default/assets/js/header/module/search"], function() {});